LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cache_dir doubt (https://www.linuxquestions.org/questions/linux-newbie-8/cache_dir-doubt-919503/)

loveulinux 12-19-2011 10:14 AM

cache_dir doubt
 
Hi..everybody,
I have configured squid proxy server. It is working fine and nearly 100 PCs are accessing internet through proxy. I have given the cache size as 250 GB out of 350 GB of /var partition
Code:

cache_dir ufs /var/spool/squid3 250000 16 256
Daily I am checking the size and the /var/spool/squid3 directory size is growing as minimum 600 MB to 1GB daily. I have some doubts here.
Will the squid stops storing cache when the cache size reaches 250GB? or Will it be overwriting with old cache? if it will be overwriting with old cache then how to confirm that old cache is overwriting? Or should I delete cache using "rm -rf /var/spool/squid3/* when it reaches to 250GB? or should I not delete cache? And how to confirm that the recently browsed pages are accessing through cache because if I do
tail -f /var/log/squid3/access.log
the many of the request as showing "direct"
Code:

1324204919.920    114 192.168.0.100 TCP_MISS/200 1251 GET http://www.google.co.in/images/firefox/alert.png - DIRECT/74.125.236.48 image/png
But if I refresh the pages then it shows as Hit
Code:

1324204920.406      6 192.168.0.100 TCP_HIT/301 800 GET http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml - NONE/- text/html
I hope someone will definitely clear my doubt.

loveulinux 12-20-2011 09:44 AM

Hi..masters, please help me for above doubts.

salasi 12-20-2011 03:10 PM

I am not going to claim any mastery, but:

Quote:

...the many of the request as showing "direct"...But if I refresh the pages then it shows as Hit
so, the right thing is happening there, so that particular point gives no cause for concern.

Quote:

Will the squid stops storing cache when the cache size reaches 250GB? or Will it be overwriting with old cache? if it will be overwriting with old cache then how to confirm that old cache is overwriting? Or should I delete cache using "rm -rf /var/spool/squid3/* when it reaches to 250GB? or should I not delete cache?
Squid should manage it; that is, the cache size should continue growing until it runs out of room and then it should stop growing, because at that point it should start deleting old entries in order to make room for the new entries. Now 250 G is a lot and it will probably take you a while to get there (...and I have doubts about whether you will be getting an advantage out of that, because pages may be stale before they fill up the amount of memory, but that isn't the issue here...).

Why don't you, as an experiment set the cache to a different, much smaller, file, so that you can then watch if squid does the right thing. If it behaves correctly with a smaller cache file, it seems quite likely that it will behave correctly with a larger file. Just a thought.

loveulinux 12-20-2011 08:06 PM

Thank you salasi, I will check it with smaller size first.


All times are GMT -5. The time now is 06:13 AM.