Squid on FreeBSD
Additions to /etc/make.conf
CFLAGS=-O3 -pipe
SQUID_CONFIGURE_ARGS=--enable-storeio=diskd,ufs --enable-snmp --disable-ident-lookups --with-pthreads --with-aio
Reconfigure kernel for squid diskd support
The kernel must have:
Additional parameters to be set in the kernel are as follows:
options MSGMNB=8192 # max # of bytes in a queue
options MSGMNI=40 # number of message queue identifiers
options MSGSEG=512 # number of message segments per queue
options MSGSSZ=64 # size of a message segment
options MSGTQL=2048 # max messages in system
Explanation of the kernel options:
The messages between Squid and diskd are 32 bytes for 32-bit CPUs and 40 bytes for 64-bit CPUs. Thus, MSGSSZ should be 32 or greater. You may want to set it to a larger value, just to be safe.
We'll have two queues for each cache_dir, one in each direction. So, MSGMNI needs to be at least two times the number of cache_dir's.
I've found that 75 messages per queue is about the limit of decent performance. If each diskd message consists of just one segment (depending on your value of MSGSSZ), then MSGSEG should be greater than 75.
MSGMNB and MSGTQL affect how many messages can be in the queues at one time. Diskd messages shouldn't be more than 40 bytes, but let's use 64 bytes to be safe. MSGMNB should be at least 64*75. It is recommend to round up to the nearest power of two, or 8192.
MSGTQL should be at least 75 times the number of cache_dir's that you'll have.
Additional performace can be obtained by commenting out any unnecessary or unneeded features in the kernel configuration.
FreeBSD Log Rotation
Additions to /etc/newsyslog.conf
/usr/local/squid/logs/access.log squid:squid 644 3 30000 * ZB /usr/local/squid/logs/squid.pid 30
/usr/local/squid/logs/store.log squid:squid 644 3 30000 * ZB /user/local/squid/logs/squid.pid 30
/usr/local/squid/logs/cache.log squid:squid 644 3 30000 * ZB /usr/local/squid/logs/squid.pid 30
Squid on Solaris 10
Additions to /etc/system
set rlim_fd_cur=8192
set rlim_fd_max=16384
This parameter defines the hard limit of open files you can have. For a Squid and most other servers, regardless of TCP or UDP, the number of open file descriptors per user process is among the most important parameter. The number of file descriptors is one limit on the number of connections you can have in parallel. You can find out the value of your hard limit on a shell with something like `ulimit -Hn`
You should consider a value of at least 2 * tcp_conn_req_max and you should provide at least 2 * rlim_fd_cur. The predicate rlim_fd_cur <= rlim_fd_max must be fulfilled.
Busy proxies will have to increase this value, though. A good starting seems to be 16384 <= x <= 32768. Remember to change the Makefile for Squid to use poll() instead of select(). Also remember that each call of configure will change the Makefile back, if you didn't change Makefile.in.
Any decent application will incorporate code to increase its soft limit to a possibly higher hard limit. Squid, as such an application, only cares about the hard limit.
Squid MIB
OID ClientHttpRequests 1.3.6.1.4.1.3495.1.3.2.1.1
OID HttpHits 1.3.6.1.4.1.3495.1.3.2.1.2
OID HttpErrors 1.3.6.1.4.1.3495.1.3.2.1.3
OID HttpInKb 1.3.6.1.4.1.3495.1.3.2.1.4
OID HttpOutKb 1.3.6.1.4.1.3495.1.3.2.1.5
OID ICPpktsSent 1.3.6.1.4.1.3495.1.3.2.1.6
OID ICPpktsRecv 1.3.6.1.4.1.3495.1.3.2.1.7
OID ICPkbSent 1.3.6.1.4.1.3495.1.3.2.1.8
OID ICPkbRecv 1.3.6.1.4.1.3495.1.3.2.1.9
OID ServerRequests 1.3.6.1.4.1.3495.1.3.2.1.10
OID ServerErrors 1.3.6.1.4.1.3495.1.3.2.1.11
OID ServerInKb 1.3.6.1.4.1.3495.1.3.2.1.12
OID ServerOutKb 1.3.6.1.4.1.3495.1.3.2.1.13
OID CurrentSwapSize 1.3.6.1.4.1.3495.1.3.2.1.14
OID SysPageFaults 1.3.6.1.4.1.3495.1.3.1.1
OID MemUsage 1.3.6.1.4.1.3495.1.3.1.4
OID CpuUsage 1.3.6.1.4.1.3495.1.3.1.5
OID MaxResSize 1.3.6.1.4.1.3495.1.3.1.6
OID NumObjCount 1.3.6.1.4.1.3495.1.3.1.7
OID CurrentLRUExpiration 1.3.6.1.4.1.3495.1.3.1.8
OID CurrentUnlinkRequests 1.3.6.1.4.1.3495.1.3.1.9
OID CurrentUnusedFileDescrCount 1.3.6.1.4.1.3495.1.3.1.10
OID CurrentReservedFileDescrCount 1.3.6.1.4.1.3495.1.3.1.11
OID HttpAllSvcTimeFiveMin 1.3.6.1.4.1.3495.1.3.2.2.1.2.5
OID HttpMissSvcTimeFiveMin 1.3.6.1.4.1.3495.1.3.2.2.1.3.5
OID HttpNmSvcTimeFiveMin 1.3.6.1.4.1.3495.1.3.2.2.1.4.5
OID HttpHitSvcTimeFiveMin 1.3.6.1.4.1.3495.1.3.2.2.1.5.5
OID IcpQuerySvcTimeFiveMin 1.3.6.1.4.1.3495.1.3.2.2.1.6.5
OID IcpReplySvcTimeFiveMin 1.3.6.1.4.1.3495.1.3.2.2.1.7.5
OID DnsSvcTimeFiveMin 1.3.6.1.4.1.3495.1.3.2.2.1.8.5
OID HttpAllSvcTimeHourly 1.3.6.1.4.1.3495.1.3.2.2.1.2.60
OID HttpMissSvcTimeHourly 1.3.6.1.4.1.3495.1.3.2.2.1.3.60
OID HttpNmSvcTimeHourly 1.3.6.1.4.1.3495.1.3.2.2.1.4.60
OID HttpHitSvcTimeHourly 1.3.6.1.4.1.3495.1.3.2.2.1.5.60
OID IcpQuerySvcTimeHourly 1.3.6.1.4.1.3495.1.3.2.2.1.6.60
OID IcpReplySvcTimeHourly 1.3.6.1.4.1.3495.1.3.2.2.1.7.60
OID DnsSvcTimeHourly 1.3.6.1.4.1.3495.1.3.2.2.1.8.60
OID HttpAllSvcTimeOneMin 1.3.6.1.4.1.3495.1.3.2.2.1.2.1
OID HttpMissSvcTimeOneMin 1.3.6.1.4.1.3495.1.3.2.2.1.3.1
OID HttpHitSvcTimeOneMin 1.3.6.1.4.1.3495.1.3.2.2.1.5.1
Comments (0)
You don't have permission to comment on this page.