]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rock and shared memory caches fixes/improvements.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 24 Jun 2014 23:48:37 +0000 (17:48 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 24 Jun 2014 23:48:37 +0000 (17:48 -0600)
* 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.

1  2 
src/tests/stub_store.cc

index 72b94c94afdd0c0991e12a2ab2f790d9a401397a,930653697e1b00c6d8105a6509de0324192be597..ed904b575a60be4a7085f832c980080e5532ba76
@@@ -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)