]> git.ipfire.org Git - thirdparty/squid.git/commit
Convert LRU map into a CLP map (#593)
authorAmos Jeffries <yadij@users.noreply.github.com>
Sun, 26 Jul 2020 02:21:58 +0000 (02:21 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 26 Jul 2020 06:28:17 +0000 (06:28 +0000)
commit7224761075454417d79b689d839c6e950e49924b
treebd9e4daeff9e1e07225966c5128b78795459034e
parentd8ee9e8dff4831fa49d2a5ed661ca3ad81b7100e
Convert LRU map into a CLP map (#593)

Revamped LruMap implementation, adding support for value-specific TTLs,
value-specific memory consumption estimates, memory pooling for value
wrappers, and polishing code. Renamed the result to ClpMap.

Fixed memory leak of generated fake SSL certificates in Squids
configured with dynamic_cert_mem_cache_size=0 (the default is 4MB).

Controversially changed sslcrtvalidator_program cache and TTL defaults:

* After we started accounting for key lengths in validator cache
  entries, the old 2048 bytes default size became not just ridiculously
  small but insufficient to cache the vast majority of cache entries
  because an entry key contains a PEM certificate sent to the validator
  (among other validation parameters). A PEM certificate usually
  consumes at least a few kilobytes. Living the old 2KB default would
  essentially mean that we are disabling caching (by default).

* And if we fix one default, it makes sense to fix the other as well.
  The old 60 second TTL default felt too conservative. Most certificate
  invalidations last days, not seconds. We picked one hour because that
  value is still fairly conservative, used as the default by several
  other Squid caches, and should allow for decent cache hit ratio.

Dropped support for the undocumented "sslcrtvalidator_program ttl=-1"
hack that meant unlimited TTL. Large TTL values should be used instead.
TODO: The option parser should be revamped to reject too-large values.
18 files changed:
src/SquidMath.h
src/base/ClpMap.h [new file with mode: 0644]
src/base/LruMap.h [deleted file]
src/base/Makefile.am
src/base/Optional.h [new file with mode: 0644]
src/base/forward.h
src/cf.data.pre
src/client_side.cc
src/mem/PoolingAllocator.h
src/ssl/cert_validate_message.cc
src/ssl/cert_validate_message.h
src/ssl/context_storage.cc
src/ssl/context_storage.h
src/ssl/helper.cc
src/ssl/helper.h
src/ssl/support.cc
src/ssl/support.h
src/tests/stub_libsslsquid.cc