| Index | Alphabetical Index |
Option Name: | cache_dir |
---|---|
Replaces: | |
Requires: | |
Default Value: | none |
Suggested Config: |
# Uncomment and adjust the following to add a disk cache directory. #cache_dir ufs /usr/local/squid/var/cache 100 16 256 |
Usage: cache_dir Type Directory-Name Fs-specific-data [options] You can specify multiple cache_dir lines to spread the cache among different disk partitions. Type specifies the kind of storage system to use. Only "ufs" is built by default. To enable any of the other storage systems see the --enable-storeio configure option. 'Directory' is a top-level directory where cache swap files will be stored. If you want to use an entire disk for caching, this can be the mount-point directory. The directory must exist and be writable by the Squid process. Squid will NOT create this directory for you. The ufs store type: "ufs" is the old well-known Squid storage format that has always been there. cache_dir ufs Directory-Name Mbytes L1 L2 [options] 'Mbytes' is the amount of disk space (MB) to use under this directory. The default is 100 MB. Change this to suit your configuration. Do NOT put the size of your disk drive here. Instead, if you want Squid to use the entire disk drive, subtract 20% and use that value. 'L1' is the number of first-level subdirectories which will be created under the 'Directory'. The default is 16. 'L2' is the number of second-level subdirectories which will be created under each first-level directory. The default is 256. The aufs store type: "aufs" uses the same storage format as "ufs", utilizing POSIX-threads to avoid blocking the main Squid process on disk-I/O. This was formerly known in Squid as async-io. cache_dir aufs Directory-Name Mbytes L1 L2 [options] see argument descriptions under ufs above The diskd store type: "diskd" uses the same storage format as "ufs", utilizing a separate process to avoid blocking the main Squid process on disk-I/O. cache_dir diskd Directory-Name Mbytes L1 L2 [options] [Q1=n] [Q2=n] see argument descriptions under ufs above Q1 specifies the number of unacknowledged I/O requests when Squid stops opening new files. If this many messages are in the queues, Squid won't open new files. Default is 64 Q2 specifies the number of unacknowledged messages when Squid starts blocking. If this many messages are in the queues, Squid blocks until it receives some replies. Default is 72 When Q1 < Q2 (the default), the cache directory is optimized for lower response time at the expense of a decrease in hit ratio. If Q1 > Q2, the cache directory is optimized for higher hit ratio at the expense of an increase in response time. The coss store type: NP: COSS filesystem in Squid-3 has been deemed too unstable for production use and has thus been removed from this release. We hope that it can be made usable again soon. block-size=n defines the "block size" for COSS cache_dir's. Squid uses file numbers as block numbers. Since file numbers are limited to 24 bits, the block size determines the maximum size of the COSS partition. The default is 512 bytes, which leads to a maximum cache_dir size of 512<<24, or 8 GB. Note you should not change the coss block size after Squid has written some objects to the cache_dir. The coss file store has changed from 2.5. Now it uses a file called 'stripe' in the directory names in the config - and this will be created by squid -z. Common options: no-store, no new objects should be stored to this cache_dir max-size=n, refers to the max object size in bytes this cache_dir supports. It is used to select the cache_dir to store the object. Note: To make optimal use of the max-size limits you should order the cache_dir lines with the smallest max-size value first and the ones with no max-size specification last. Note for coss, max-size must be less than COSS_MEMBUF_SZ, which can be changed with the --with-coss-membuf-size=N configure option. |
|
| Index | Alphabetical Index |