< Day Day Up > |
A swap.state file is a journal of objects that have been added to, and removed from, a cache directory. Each cache_dir has its own swap.state file. When Squid starts up, it reads the swap.state files to rebuild its in-memory indexes of cached objects. These files are a relatively critical part of Squid's operation. By default, each swap.state file is located in its corresponding cache directory. Thus, each state file automatically stays with each cache_dir . This is important if you ever decide to reorder your cache_dir lines or if you remove one or more from the list. If you prefer to put them in a different location, you can use the cache_swap_log directive: cache_swap_log /usr/local/squid/var/logs/swap.state In this case, Squid creates a swap.state file for each directory by appending a numeric suffix. For example, if you have four cache directories, Squid creates the following: /usr/local/squid/var/logs/swap.state.00 /usr/local/squid/var/logs/swap.state.01 /usr/local/squid/var/logs/swap.state.02 /usr/local/squid/var/logs/swap.state.03 In this situation, if you add, remove, or rearrange cache_dir lines, you may need to rename the swap.state files manually to keep everything consistent. Technically, the swap.state format is storage scheme-dependent. However, all storage schemes use the same format in the current versions of Squid. The swap.state file uses a fixed- size (48-byte) binary format. Fields are written in host-byte order and are thus not necessarily portable between different operating systems. Table 13-3 describes the fields of a swap.state entry. Table 13-3. swap.state entry fields
|
< Day Day Up > |