From: Dmitry Kurochkin Date: Mon, 18 Apr 2011 13:30:00 +0000 (+0400) Subject: Do not create shared memory pools and warn if we cannot cache a single item. X-Git-Tag: take06~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f2ac0f7cfccab0de86c0d31c1733fcbe6a472f2;p=thirdparty%2Fsquid.git Do not create shared memory pools and warn if we cannot cache a single item. --- diff --git a/src/MemStore.cc b/src/MemStore.cc index fe6680036b..0c34e38e26 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -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; } diff --git a/src/ipc/mem/Pages.cc b/src/ipc/mem/Pages.cc index 259720d400..61684b6e77 100644 --- a/src/ipc/mem/Pages.cc +++ b/src/ipc/mem/Pages.cc @@ -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