| Index | Alphabetical Index |
Option Name: | cache_dir |
---|---|
Replaces: | |
Requires: | |
Default Value: | none |
Suggested Config: |
|
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. Only using COSS, a raw disk device or a stripe file can be specified, but the configuration of the "cache_swap_log" tag is mandatory. 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. 'Level-1' is the number of first-level subdirectories which will be created under the 'Directory'. The default is 16. 'Level-2' 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: 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. overwrite-percent=n defines the percentage of disk that COSS must write to before a given object will be moved to the current stripe. A value of "n" closer to 100 will cause COSS to waste less disk space by having multiple copies of an object on disk, but will increase the chances of overwriting a popular object as COSS overwrites stripes. A value of "n" close to 0 will cause COSS to keep all current objects in the current COSS stripe at the expense of the hit rate. The default value of 50 will allow any given object to be stored on disk a maximum of 2 times. max-stripe-waste=n defines the maximum amount of space that COSS will waste in a given stripe (in bytes). When COSS writes data to disk, it will potentially waste up to "max-size" worth of disk space for each 1MB of data written. If "max-size" is set to a large value (ie >256k), this could potentially result in large amounts of wasted disk space. Setting this value to a lower value (ie 64k or 32k) will result in a COSS disk refusing to cache larger objects until the COSS stripe has been filled to within "max-stripe-waste" of the maximum size (1MB). membufs=n defines the number of "memory-only" stripes that COSS will use. When an cache hit is performed on a COSS stripe before COSS has reached the overwrite-percent value for that object, COSS will use a series of memory buffers to hold the object in while the data is sent to the client. This will define the maximum number of memory-only buffers that COSS will use. The default value is 10, which will use a maximum of 10MB of memory for buffers. maxfullbufs=n defines the maximum number of stripes a COSS partition will have in memory waiting to be freed (either because the disk is under load and the stripe is unwritten, or because clients are still transferring data from objects using the memory). In order to try and maintain a good hit rate under load, COSS will reserve the last 2 full stripes for object hits. (ie a COSS cache_dir will reject new objects when the number of full stripes is 2 less than maxfullbufs) The null store type: no options are allowed or required Common options: no-store, no new objects should be stored to this cache_dir min-size=n, refers to the min object size this storedir will accept. It's used to restrict a storedir to only store large objects (e.g. aufs) while other storedirs are optimized for smaller objects (e.g. COSS). Defaults to 0. max-size=n, refers to the max object size this storedir supports. It is used to initially choose the storedir to dump 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 that for coss, max-size must be less than COSS_MEMBUF_SZ (hard coded at 1 MB). |
|
| Index | Alphabetical Index |