Feature #15626
openFeature Request: Squid 6.6 Rock cache directory
0%
Description
Hello fellow Redmine members,
I researched and found a cache file system is missing from php GUI options.
This file system is recommended per Squid Email Support. However is missing in the GUI of Squid 6.6 the latest release on pfSense that addresses the security issues in prior versions.
“….. If Squid in question does disk caching, then rock cache_dirs may be the best bet.” Alex Rousskov
The GUI Squid php code currently does not list ROCK as an option
==== The rock store type ====
Usage:
cache_dir rock Directory-Name Mbytes [options]
The Rock Store type is a database-style storage. All cached
entries are stored in a "database" file, using fixed-size slots.
A single entry occupies one or more slots.
If possible, Squid using Rock Store creates a dedicated kid
process called "disker" to avoid blocking Squid worker(s) on disk
I/O. One disker kid is created for each rock cache_dir. Diskers
are created only when Squid, running in daemon mode, has support
for the IpcIo disk I/O module.swap-timeout=msec: Squid will not start writing a miss to or
reading a hit from disk if it estimates that the swap operation
will take more than the specified number of milliseconds. By
default and when set to zero, disables the disk I/O time limit
enforcement. Ignored when using blocking I/O module because
blocking synchronous I/O does not allow Squid to estimate the
expected swap wait time.max-swap-rate=swaps/sec: Artificially limits disk access using
the specified I/O rate limit. Swap out requests that
would cause the average I/O rate to exceed the limit are
delayed. Individual swap in requests (i.e., hits or reads) are
not delayed, but they do contribute to measured swap rate and
since they are placed in the same FIFO queue as swap out
requests, they may wait longer if max-swap-rate is smaller.
This is necessary on file systems that buffer "too
many" writes and then start blocking Squid and other processes
while committing those writes to disk. Usually used together
with swap-timeout to avoid excessive delays and queue overflows
when disk demand exceeds available disk "bandwidth". By default
and when set to zero, disables the disk I/O rate limit
enforcement. Currently supported by IpcIo module only.slot-size=bytes: The size of a database "record" used for
storing cached responses. A cached response occupies at least
one slot and all database I/O is done using individual slots so
increasing this parameter leads to more disk space waste while
decreasing it leads to more disk I/O overheads. Should be a
multiple of your operating system I/O page size. Defaults to
16KBytes. A housekeeping header is stored with each slot and
smaller slot-sizes will be rejected. The header is smaller than
100 bytes.==== COMMON OPTIONS ====
no-store no new objects should be stored to this cache_dir.
min-size=n the minimum object size in bytes this cache_dir
will accept. It's used to restrict a cache_dir
to only store large objects (e.g. AUFS) while
other stores are optimized for smaller objects
(e.g. Rock).
Defaults to 0.max-size=n the maximum object size in bytes this cache_dir
supports.
The value in maximum_object_size directive sets
the default unless more specific details are
available (ie a small store capacity).Note: To make optimal use of the max-size limits you should order
the cache_dir lines with the smallest max-size value first.
Updated by Jonathan Lee 5 months ago
While researching per Squid support emails.
On 2024-07-18 00:33, Jonathan Lee wrote:
What would be the correct way to convert cache_dir disks to rock?
One cannot convert a cache_dir of another type to rock cache_dir. You will need to start from scratch, using a rock-dedicated cache_dir path (initialized by running "squid -z" after updating squid.conf). If you want to reuse the same path, then move or remove the old/diskd contents first.
cache_dir diskd /var/squid/cache 64000 256 256
Would it be as simple as..
cache_dir rock /var/squid/cache 64000 256 256?
See cache_dir directive in squid.conf.documented; diskd and rock cache_dirs have different configuration syntax because rock cache_dirs do not have/need L1 and L2 parameters required for diskd cache_dirs:
cache_dir diskd Directory-Name Mbytes L1 L2 [options]
cache_dir rock Directory-Name Mbytes [options]
HTH,
Alex.