, DNS .
DNS ( IMHO) .
access.log, :
Host Ident - [D/M/Yr:H:M:S TZ] "Method URL" Status Sizeaccess.log, Squid 1.0 :
Time Elapsed Host Status/HTTP/Hier_Status Size Method URLaccess.log, Squid 1.1 :
Time Elapsed Host Status/HTTP Size Method URL Ident Hier_Status/Hier_Hosthierarchy.log, Squid 1.0:
[D/M/Yr:H:M:S TZ] URL Hier_Status Hier_Hostlog:
kill -USR1 `cat /usr/local/squid/logs/squid.pid`
: logfile_rotate squid.conf log . logfile_rotate . logfile_rotate , log . logfile_rotate crontab squid ' SIGUSR1, :
0 0 * * * /bin/kill -USR1 `cat /usr/local/squid/logs/squid.pid`
, log, cache_dir . , Squid. .
sort -r -n +4 -5 access.log | awk '{print $5, $7}' | head -25
, , log cache_dir.
, web , SIGHUP, .
web , - URL:
http://www.example.com/Squid/cgi-bin/cachemgr.cgi
Protection MGR-PROT { Mask @(workstation.example.com) }, IP , . . .
:
Protect /Squid/* MGR-PROT Exec /Squid/cgi-bin/*.cgi /usr/local/squid/bin/*.cgiMGR-PROT, .
ScriptAlias /Squid/cgi-bin/ /usr/local/squid/cgi-bin/ScriptAlias /usr/local/squid/bin Squid.
, -. access.conf Apache, squid.conf. access.conf, :
<Location /Squid/cgi-bin/cachemgr.cgi> order deny,allow deny from all allow from workstation.example.com </Location>, .
, cachemgr.cgi . access.conf:
<Location /Squid/cgi-bin/cachemgr.cgi> AuthUserFile /path/to/password/file AuthGroupFile /dev/null AuthName User/Password Required AuthType Basic <Limit GET> require user cachemanager </Location>Apache htpasswd .
acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl all src 0.0.0.0/0.0.0.0:
http_access deny manager !localhost http_access allow allACL -, squid cache_object . :
telnet mycache.example.com 3128
GET cache_object://mycache.example.com/info HTTP/1.0
, cache_object, , , - .
, , cachemgr.cgi localhost. :
acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl example src 123.123.123.123/255.255.255.255 acl all src 0.0.0.0/0.0.0.0123.123.123.123 IP web . :
http_access deny manager !localhost !example http_access allow all, web , squid. , - squid web , . , web - , IP web , cachemgr.cgi example .
squid.conf SIGHUP squid'.
HOST_OPT = # -DCACHEMGR_HOSTNAME="getfullhostname()"web cachemgr.cgi , Squid #. web - , :
HOST_OPT = -DCACHEMGR_HOSTNAME=\"mycache.example.com\"cachemgr.cgi.
squid , , ! - , squid.
Flags:
N IP , hostname.
IP , IP cache.
Memory usage for squid via mallinfo(): Total space in arena: 94687 KB Ordinary blocks: 32019 KB 210034 blks Small blocks: 44364 KB 569500 blks Holding blocks: 0 KB 5695 blks Free Small blocks: 6650 KB Free Ordinary blocks: 11652 KB Total in use: 76384 KB 81% Total free: 18302 KB 19% Meta Data: StoreEntry 246043 x 64 bytes = 15377 KB IPCacheEntry 971 x 88 bytes = 83 KB Hash link 2 x 24 bytes = 0 KB URL strings = 11422 KB Pool MemObject structures 514 x 144 bytes = 72 KB ( 70 free) Pool for Request structur 516 x 4380 bytes = 2207 KB ( 2121 free) Pool for in-memory object 6200 x 4096 bytes = 24800 KB ( 22888 free) Pool for disk I/O 242 x 8192 bytes = 1936 KB ( 1888 free) Miscellaneous = 2600 KB total Accounted = 58499 KBmallinfo() , r 94M. , top (97M).
94M, 81% (76M) . , malloc(3) .
76M , 58.5M (76%). malloc(3).
Meta Data , . 45% StoreEntry URL . 42% , (Pool for in-memory object).
squid.conf. 1.0, : , . Pool for in-memory object, 1/2 cache_mem. Pool for disk I/O 200. MemObject Request 1/8 FD_SETSIZE.
, 'http', 'ftp' 'gopher' . cache_mem. cache_mem , . Squid memory_pools off .
:
============================================================================== IP Cache Contents: Hostname Flags lstref TTL N [IP-Number] gorn.cc.fh-lippe.de C 0 21581 1 193.16.112.73 lagrange.uni-paderborn.de C 6 21594 1 131.234.128.245 www.altavista.digital.com C 10 21299 4 204.123.2.75 204.74.103.37 204.123.2.66 204.123.2.69 2/ftp.symantec.com DL 1583 -772855 0 Flags: C --> D --> N --> L --> lstref: TTL: Time-To-Live ( ) N: ============================================================================== FQDN Cache Contents: IP-Number Flags TTL(?) N Hostname] 130.149.17.15 C -45570 1 andele.cs.tu-berlin.de 194.77.122.18 C -58133 1 komet.teuto.de 206.155.117.51 N -73747 0 Flags: C --> D --> N --> L --> TTL: Time-To-Live N:
http_accel_with_proxy on
, ACL. access.log squid.conf.
local_domain . . , cache_stoplist http_stop ( ).
Linux, filehandle.patch.linux Michael O'Reilly <michael@metal.iinet.net.au>.
Solaris, /etc/system:
set rlim_fd_max = 4096
set rlim_fd_cur = 1024
#define SQUID_FD_SETSIZE include/config.h , rlim_fd_max. 4096.
Solaris select(2) 1024 , src/Makefile $(USE_POLL_OPT). squid.
FreeBSD ( Torsten Sturm <torsten.sturm@axis.de>):
cd squid-1.1.x make realclean ./configure --prefix=/usr/local/squid make
options DFLDSIZ=67108864 # 64 meg default max data size (was 16) options MAXDSIZ=134217728 # 128 meg max data size (was 64).
Digital UNIX, /etc/sysconfigtab ...
proc: per-proc-data-size=1073741824, csh, limit ...
/etc/sysconfigtab , limit - .
97/01/23 22:31:10| Removed 1 of 9 objects from bucket 3913 97/01/23 22:33:10| Removed 1 of 5 objects from bucket 4315 97/01/23 22:35:40| Removed 1 of 14 objects from bucket 6391log , , squid cache_swap_high.
cache information cachemgr.cgi :
Storage LRU Expiration Age: 364.01 days, , . LRU Expiration Age reference_age .
FATAL: Don't run Squid as root, set 'cache_effective_user'!, cache_effective_user nobody, . , Squid cache_effective_user.
UID nobody 65535 65534.
( ), "Properties" , "directories", "Directory listing style." "Unix" type, "MS-DOS" type.
--Oskar Pearson <oskar@is.co.za>(1) , DNS. -, . IP DNS, Squid 'udp_outgoing_address'.
:
# (squid.conf ) # udp_outgoing_address proxy.parent.com # ( squid.conf) # cache_host proxy.parent.com parent 3128 3130(2) ICP . , Squid , . , log . , , , , .
ICP . squid , ICP , ICP "HIT" ("") "MISS" (""). MISS.
ICP TCP . ICP UDP. Squid ICP.
Squid /, DNS . dnsserver DNS, squid`.
, ftpput.
/ , squid , , . , Internet, , . , "".
single_parent_bypass ICP , ( , , ?)
, http://squid.nlanr.net/Squid/Devel/todo.html.
http://squid.nlanr.net/Squid/Devel/.