From: Alex Rousskov Date: Tue, 24 Jun 2014 23:48:37 +0000 (-0600) Subject: Rock and shared memory caches fixes/improvements. X-Git-Tag: SQUID_3_5_0_1~170 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=579b60e6eb80b629d8820e98f8bd4a5cb72f2350;p=thirdparty%2Fsquid.git Rock and shared memory caches fixes/improvements. * Bug fixes: Avoid "FATAL: Squid has attempted to read data from memory that is not present" crashes. Improve related code. Lifted 16777216 slot limit from rock cache_dirs and shared memory caches. Caches larger than 256GB (assuming default 16KB cache_dir slot-size) require this fix to use disk space beyond 256GB. Also fixed rock disk space waste warning. Restored Squid ability to cache (in memory) when no disk caches are configured which was lost during r12662 "Bug 3686: cache_dir max-size default fails" but other bugs hid this problem. Allow HITs on entries backed by a shared memory cache only. Avoid store_client.cc "entry->swap_filen > -1 || entry->swappingOut()" asserts. Make sure Squid dumps core and not just promises one when memory management goes wrong. * Significant RAM usage reduction: Significantly reduced Large Rock (and slightly shared memory) RAM requirements by not allocating 40 (and 12) bytes of unused RAM per cache slot. Stop wasting 96 RAM bytes per slot for high-offset slots in large shared caches with more than 16777216 slots. For example, a StoreMap for a 1TB shared cache with default 16KB slot sizes (67108864 slots) occupied about 6.5GB of RAM. After this change, the same information is stored in about 2.0GB because unused anchors are not stored. * Other improvements: Document counter-intuitive round-robin cache_dir selection; decrease its bias. Report IpcIo file name with errors and warnings to inform admin which cache_dir needs troubleshooting or tuning. --- 579b60e6eb80b629d8820e98f8bd4a5cb72f2350 diff --cc src/tests/stub_store.cc index 72b94c94af,930653697e..ed904b575a --- a/src/tests/stub_store.cc +++ b/src/tests/stub_store.cc @@@ -46,7 -46,7 +46,7 @@@ void StoreEntry::purgeMem() STU void StoreEntry::swapOut() STUB void StoreEntry::swapOutFileClose(int how) STUB const char *StoreEntry::url() const STUB_RETVAL(NULL) - int StoreEntry::checkCachable() STUB_RETVAL(0) -bool StoreEntry::checkCachable() STUB_RETVAL(0) ++bool StoreEntry::checkCachable() STUB_RETVAL(false) int StoreEntry::checkNegativeHit() const STUB_RETVAL(0) int StoreEntry::locked() const STUB_RETVAL(0) int StoreEntry::validToSend() const STUB_RETVAL(0)