]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not create shared memory pools and warn if we cannot cache a single item.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Mon, 18 Apr 2011 13:30:00 +0000 (17:30 +0400)
committerDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Mon, 18 Apr 2011 13:30:00 +0000 (17:30 +0400)
src/MemStore.cc
src/ipc/mem/Pages.cc

index fe6680036bf45526b0879a15585e37f4865edb3c..0c34e38e26a365b1e00da78b35ff7c2e9d59bc87 100644 (file)
@@ -353,7 +353,6 @@ MemStore::EntryLimit()
 
     const int64_t entrySize = Ipc::Mem::PageSize(); // for now
     const int64_t entryLimit = Config.memMaxSize / entrySize;
-    // TODO: warn if we cannot cache at least one item (misconfiguration)
     return entryLimit;
 }
 
index 259720d4007d18afee9ebc57bf8f259a25c401ad..61684b6e77bab691cb831e12b70baefd027e63a0 100644 (file)
@@ -100,6 +100,15 @@ void SharedMemPagesRr::run(const RunnerRegistry &)
     if (!Ipc::Mem::Limit())
         return;
 
+    if (Ipc::Mem::Limit() < Ipc::Mem::PageSize()) {
+        if (IamMasterProcess()) {
+            debugs(54, DBG_IMPORTANT, "WARNING: mem-cache size is too small ("
+                   << (Ipc::Mem::Limit() / 1024.0) << " KB), should be >= " <<
+                   (Ipc::Mem::PageSize() / 1024.0) << " KB");
+        }
+        return;
+    }
+
     if (IamMasterProcess())
         Ipc::Mem::Init();
     else