]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4312: Support disabling collapsed forwarding SMP cooperation
authorDave Dykstra <dwd@fnal.gov>
Wed, 30 Mar 2016 11:55:02 +0000 (00:55 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 30 Mar 2016 11:55:02 +0000 (00:55 +1300)
src/SquidConfig.h
src/Transients.cc
src/cache_cf.cc
src/cf.data.depend
src/cf.data.pre

index 5c03b2ffc7360f58ffee346903b54f24068f4105..97842d81ffc42c4da5b242cab82acd13598f6613 100644 (file)
@@ -341,6 +341,8 @@ public:
 #endif
     } onoff;
 
+    int64_t collapsed_forwarding_shared_entries_limit;
+
     int pipeline_max_prefetch;
 
     int forward_max_tries;
index 98963eb2611046925b94115a909cf7b417676000..acb5029e5ff4e2e100bdaa09d972ec740a0bcc14 100644 (file)
@@ -370,7 +370,7 @@ Transients::EntryLimit()
     if (!UsingSmp() || !Config.onoff.collapsed_forwarding)
         return 0; // no SMP collapsed forwarding possible or needed
 
-    return 16*1024; // TODO: make configurable?
+    return Config.collapsed_forwarding_shared_entries_limit;
 }
 
 /// initializes shared memory segment used by Transients
index 40c6c41da21aad742176c33edcbbf637827dfe84..699d06697ff7034e4b62977ceb51040db21e89c7 100644 (file)
@@ -2456,6 +2456,26 @@ free_int(int *var)
     *var = 0;
 }
 
+static void
+dump_int64_t(StoreEntry * entry, const char *name, int64_t var)
+{
+    storeAppendPrintf(entry, "%s %" PRId64 "\n", name, var);
+}
+
+void
+parse_int64_t(int64_t *var)
+{
+    int64_t i;
+    i = GetInteger64();
+    *var = i;
+}
+
+static void
+free_int64_t(int64_t *var)
+{
+    *var = 0;
+}
+
 static void
 dump_onoff(StoreEntry * entry, const char *name, int var)
 {
index e36332eee33613f5062b4dcf80d17f461e9f24b9..6f325a7388237b2f3b999e3d9fca50a16104120a 100644 (file)
@@ -51,6 +51,7 @@ icap_service_failure_limit
 icmp
 ecap_service_type
 int
+int64_t
 kb_int64_t
 kb_size_t
 logformat
index d9741dcc796fd28dcf7156890e972b58fa3587c7..6c3c3fb685f7ec88f33c938a8b3499b304015cc2 100644 (file)
@@ -6189,6 +6189,27 @@ DOC_START
        simultenous refresh requests] outweigh losses from such delays.
 DOC_END
 
+NAME: collapsed_forwarding_shared_entries_limit
+COMMENT: (number of entries)
+TYPE: int64_t
+LOC: Config.collapsed_forwarding_shared_entries_limit
+DEFAULT: 16384
+DOC_START
+       This limits the size of a table used for sharing information
+       about collapsible entries among SMP workers. Limiting sharing
+       too much results in cache content duplication and missed
+       collapsing opportunities. Using excessively large values
+       wastes shared memory.
+
+       The limit should be significantly larger then the number of
+       concurrent collapsible entries one wants to share. For a cache
+       that handles less than 5000 concurrent requests, the default
+       setting of 16384 should be plenty.
+
+       If the limit is set to zero, it disables sharing of collapsed
+       forwarding between SMP workers.
+DOC_END
+
 COMMENT_START
  TIMEOUTS
  -----------------------------------------------------------------------------