Re: [squid-users] Howto Clear Cache Periodicaly

From: Guillaume Vachon <gvachon@dont-contact.us>
Date: Tue, 11 Apr 2006 11:13:30 -0400

On Tue, 2006-04-11 at 15:49 +0100, Neil A. Hillard wrote:
> Guillaume Vachon wrote:
> > On Tue, 2006-04-11 at 14:51 +0100, Neil A. Hillard wrote:
> >> Hi,
> >>
> >> mail reformatted to make sense (i.e. please don't top post!)
> >>
> >>>>> I have a squid that has been caching for like 10 month. It now have an
> >>>>> amazing size of 4.5 gig.
> >>>> What you have is determined by the cache_dir specifications
> >>>> in squid.conf. The size there is taken into account , and SQUID will
> >>>> trimm cache dirs automatically if that would be needed.
> >>>>
> >>>>
> >>>>> When browsing on the web, it is now very very
> >>>>> slow. I restarted squid with a clean cache. Everything was fine again. I
> >>>>> was wondering if there were a way to tell squid to clean cache
> >>>>> periodicaly?! So I would not have to do it myself.
> >>>>>
> >>>> - The idea of a caching proxy is to have a cache, and to benefit
> >>>> from that, not clean it.
> >>>> I run SQUID with the same cache dir and or squid maintained content
> >>>> for more then year without touching it.
> >>>> And or touching it alone, if serious SYSTEM or disk problems would occur.
> >>>>
> >>>> Make sure that your disk access performance, for instance, is adequate
> >>>> for the SQUID induced disk I/O load.
> >> >
> >>> For the computer that is running Squid it is a Dual core 3 ghz, there
> >>> is 2 gig of ram. The disk are scsi. I don't think that it is the
> >>> machine that is having the probleme. There is no probleme with the
> >>> access to disk.
> >> If you want better advice you'll need to show here how you've checked
> >> that. Have you used iostat, vmstat, etc. You may also want to post you
> >> squid.conf (stripped of comments and blank lines).
> >>
> >> Do you have multiple cache_dirs specified?
> >>
> >>> There might be solution somewhere. I mean I should not have to reset
> >>> my cache. The computer is strong enough. But still it went really
> >>> slow (so slow that browsing the web was imposible)and restarting
> >>> squid with a new cache solved the problem. What can I do to be sure
> >>> that this does not happen again
> >> Correct - you should not have to. After all, I have a dual P3-667MHz
> >> with 512Mb RAM serving over 3500 clients. Your machine is considerably
> >> more powerful.
> >>
> >> What is the machine doing when it is in this state. Is anything logged
> >> in cache.log, anything relevant in syslog?
> >>
> >>
> >> Without more information we can't really offer any advice.
> >>
> >>
> >> Neil.
> >>
> >
> > ---
> >
> > Here is my squid.conf
> >
> > pid_filename /opt2/squid-logs/squid.pid
> > redirect_program /usr/local/squid/bin/zapchain /usr/local/squid/bin/squidGuard
> > "/usr/local/squid/bin/SquidClamAV_Redirector.py
> > -c /usr/local/squid/etc/SquidClamAV_Redirector.conf"
> > redirect_children 30
> > acl localhost src 127.0.0.1/255.255.255.255
> > acl proxycsbf src 10.0.10.15/255.255.255.255
> > redirector_access deny proxycsbf
> > redirector_access deny localhost
> > auth_param basic children 5
> > auth_param basic realm Squid proxy-caching web server
> > auth_param basic credentialsttl 2 hours
> > auth_param basic casesensitive off
> > refresh_pattern ^ftp: 1440 20% 10080
> > refresh_pattern ^gopher: 1440 0% 1440
> > refresh_pattern . 0 20% 4320
> > acl all src 0.0.0.0/0.0.0.0
> > acl manager proto cache_object
> > acl to_localhost dst 127.0.0.0/8
> > acl SSL_ports port 443 563
> > acl Safe_ports port 80 # http
> > acl Safe_ports port 21 # ftp
> > acl Safe_ports port 443 563 # https, snews
> > acl Safe_ports port 70 # gopher
> > acl Safe_ports port 210 # wais
> > acl Safe_ports port 1025-65535 # unregistered ports
> > acl Safe_ports port 280 # http-mgmt
> > acl Safe_ports port 488 # gss-http
> > acl Safe_ports port 591 # filemaker
> > acl Safe_ports port 777 # multiling http
> > acl CONNECT method CONNECT
> > http_access allow manager localhost
> > http_access deny manager
> > http_access deny !Safe_ports
> > http_access deny CONNECT !SSL_ports
> > acl our_networks src 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
> > http_access allow our_networks
> > http_access deny all
> > http_reply_access allow all
> > icp_access allow all
> > cache_mgr ""
> > cache_effective_user squid
> > cache_effective_group squid
> > visible_hostname ""
> > err_html_text toot@ootot.net
> > forwarded_for off
> > cachemgr_passwd *******
> > error_directory /usr/local/squid/share/errors/French
> > coredump_dir /usr/local/squid/var/cache
>
> You don't have a cache_dir declared so squid wouldn't start with that
> config!
>
>
> >> What is the machine doing when it is in this state. Is anything logged
> >> in cache.log, anything relevant in syslog?
> >
> > Says too much file open in the cache or something like that.
>
> Please give the exact message as it will help tracing the problem. It
> sounds like you may be running out of file descriptors.
>
>
> Neil.
>

To the last message some line of my config files are missing.. this is
my total squid.conf :

http_port 8080
icp_port 0
hierarchy_stoplist cgi-bin ?
acl MS
dstdomain .windowsupdate.com .windowsupdate.microsoft.com .windows.com
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
no_cache deny MS
cache_mem 100 MB
cache_dir aufs /opt2/squid-cache/ 5000 16 256
cache_access_log /opt2/squid-logs/access.log
cache_log /opt2/squid-logs/cache.log
cache_store_log /opt2/squid-logs/store.log
pid_filename /opt2/squid-logs/squid.pid
redirect_program /usr/local/squid/bin/zapchain /usr/local/squid/bin/squidGuard
     "/usr/local/squid/bin/SquidClamAV_Redirector.py
     -c /usr/local/squid/etc/SquidClamAV_Redirector.conf"
 redirect_children 30
 acl localhost src 127.0.0.1/255.255.255.255
 acl proxycsbf src 10.0.10.15/255.255.255.255
 redirector_access deny proxycsbf
 redirector_access deny localhost
 auth_param basic children 5
 auth_param basic realm Squid proxy-caching web server
 auth_param basic credentialsttl 2 hours
 auth_param basic casesensitive off
 refresh_pattern ^ftp: 1440 20% 10080
 refresh_pattern ^gopher: 1440 0% 1440
 refresh_pattern . 0 20% 4320
 acl all src 0.0.0.0/0.0.0.0
 acl manager proto cache_object
 acl to_localhost dst 127.0.0.0/8
 acl SSL_ports port 443 563
 acl Safe_ports port 80 # http
 acl Safe_ports port 21 # ftp
 acl Safe_ports port 443 563 # https, snews
 acl Safe_ports port 70 # gopher
 acl Safe_ports port 210 # wais
 acl Safe_ports port 1025-65535 # unregistered ports
 acl Safe_ports port 280 # http-mgmt
 acl Safe_ports port 488 # gss-http
 acl Safe_ports port 591 # filemaker
 acl Safe_ports port 777 # multiling http
 acl CONNECT method CONNECT
 http_access allow manager localhost
 http_access deny manager
 http_access deny !Safe_ports
 http_access deny CONNECT !SSL_ports
 acl our_networks src 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
 http_access allow our_networks
 http_access deny all
 http_reply_access allow all
 icp_access allow all
 cache_mgr ""
 cache_effective_user squid
 cache_effective_group squid
 visible_hostname ""
 err_html_text toot@ootot.net
 forwarded_for off
 cachemgr_passwd *******
 error_directory /usr/local/squid/share/errors/French
 coredump_dir /usr/local/squid/var/cache
Received on Tue Apr 11 2006 - 09:12:33 MDT

This archive was generated by hypermail pre-2.1.9 : Mon May 01 2006 - 12:00:02 MDT