Squid_ The Definitive Guide - Duane Wessels [142]
Page faults with physical i/o
This value also comes from getrusage( ). A page fault occurs when the operating system must read a page of the process's memory from disk. This usually happens when the Squid process becomes too large to fit entirely in memory, or when the system has other programs competing for memory. Squid's performance suffers significantly when page faults occur. You probably won't notice any problems as long as the page-faults rate is an order of magnitude lower than the HTTP request rate.
You'll see a section called Memory usage for squid via mstats( ) if your system has the mstats( ) function. In particular, you'll have this function if the GNU malloc library (libgnumalloc.a) is installed. Squid reports two statistics from mstats( ):
Memory usage for squid via mstats( ):
Total space in arena: 415116 KB
Total free: 129649 KB 31%
Total space in arena
This represents the total amount of memory allocated to the process. It may be similar to the value reported by sbrk( ). Note that this value only increases over time.
Total free
This represents the amount of memory allocated to the process but not currently in use by Squid. For example, if Squid frees up some memory, it goes into this category. Squid can later reuse that memory, perhaps for a different data structure, without increasing the process size. This value fluctuates up and down over time.
The Memory accounted for section contains a few tidbits about Squid's internal memory management techniques:
Memory accounted for:
Total accounted: 228155 KB
memPoolAlloc calls: 2282058666
memPoolFree calls: 2273301305
Total accounted
Squid keeps track of some, but not nearly all, of the memory allocated to it. This value represents the total size of all data structures accounted for. Unfortunately, it is typically only about two-thirds of the actual memory usage. Squid uses a significant amount of memory in ways that make it difficult to track properly.
memPoolAlloc calls
memPoolAlloc( ) is the function through which Squid allocates many fixed-size data structures. This line shows how many times that function has been called.
memPoolFree calls
memPoolFree( ) is the companion function through which Squid frees memory allocated with memPoolAlloc( ). In a steady-state condition, the two values should increase at the same rate and their difference should be roughly constant over time. If not, the code may contain a bug that frees pooled memory back to the malloc library.
The File descriptor usage section shows how many file descriptors are available to Squid and how many are in use:
File descriptor usage for squid:
Maximum number of file descriptors: 7372
Largest file desc currently in use: 151
Number of file desc currently in use: 105
Files queued for open: 0
Available number of file descriptors: 7267
Reserved number of file descriptors: 100
Store Disk files open: 0
Maximum number of file descriptors
This is the limit on open file descriptors for the squid process. This should be the same value reported by ./configure when you compiled Squid. If you don't see at least 1024 here, you should probably go back and recompile Squid after reading Section 3.3.1.
Largest file desc currently in use
This is the highest file descriptor currently open. Its value isn't particularly important but should be within 15-20% of the next line (number currently in use). This value is more useful for developers because it corresponds to the first argument of the select( ) system call.
Number of file desc currently in use
The number of currently open descriptors is an important performance metric. In general, Squid's performance decreases as the number of open descriptors increases. The kernel must work harder to scan the larger