LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to increase cache speed in squid ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-increase-cache-speed-in-squid-854930/)

gardenair 01-07-2011 10:56 PM

How to increase cache speed in squid ?
 
Hi,
I need guidance related to squid cache.I am using Red Hat Linux as a squid proxy server. My server have 200 GB Hard Disk with 3 GB ram.
The clients mostly visit google,msn ,yahoo mail ,gmail,hotmail.
To increase the cache speed I does't know which tag should I use so my clients may access the web pages very fast. If I am correct please guide me.

In /etc/squid/squid.conf file cache_mem 16 MB as default size.Can we change it upto 500MB

Another related thing is cache_dir ufs /cache 200 16 256.The default size of cache dir is 200 so can I increase it upto 500 ?

thanks in advance.
garden

xandercage17 01-08-2011 09:54 AM

Delete My account

salasi 01-08-2011 03:16 PM

I'm sorry, but I am going to be a bit obtuse and unhelpful, at first. This is in the interests of helping you more fully.

Quote:

Originally Posted by gardenair (Post 4217033)
To increase the cache speed I does't know which tag should I use so my clients may access the web pages very fast. If I am correct please guide me.

...You seem to have the idea that there is 'a squid tag' (which I am reading as a squid configuration directive or value) which will cure all of your problems. This may not be the case...

Quote:

Originally Posted by gardenair (Post 4217033)
The clients mostly visit google,msn ,yahoo mail ,gmail,hotmail.

Caching speeds up access to things that are cached and doesn't help with things that are not cached. Three out of the five examples that you have given are mail programs. When a user points a browser at a mail program, what are the chances that there is a copy of the requested page in cache? (this is a loaded question in the sense that no other user should have previously viewed that page, ever. If the page has never been viewed before, it can't be in cache. even in the case that this user is viewing an exact page that has been viewed before, some mail programs use the nocache directive, or similar, to prevent caching, because caching = ! updating, which is bad (sort of) and this is true for many sites which dynamically generate pages)

And, for something like a google search, caching can help with pages that have been viewed before (think the opening page and going back to a previously viewed page), but can't really help when you initially do a search or initially view a page (except when someone else has looked at that self-same page).

Remember also that browsers already have caching built-in, so in attempting to improve things, you have to better the browser's internal cache.

Quote:

Originally Posted by gardenair (Post 4217033)
In /etc/squid/squid.conf file cache_mem 16 MB as default size.Can we change it upto 500MB

Another related thing is cache_dir ufs /cache 200 16 256.The default size of cache dir is 200 so can I increase it upto 500 ?

Yes, why not? But a better question is 'will it do any good?'

You can certainly try things and measure things. If you have decided to measure the right things, this will help you to decide whether changes you have made is an improvement.

As xandercage17 suggests, ensuring that you have a fast subsystem for storing squid's files is a good thing. But if you have a poor cache hit rate, having a very fast storage subsystem can't help.

gardenair 01-10-2011 10:27 PM

thanks for your replies. Well I agree with your comments that if any user will get a web page squid will save it in its cache directory and next time when ever some one will need same page squid will give it instead to go real web server.
The SQUID cache_mem 16 MB which is default is a physical cache area ? or it do all processing in RAM ?
About cache_dir ufs /cache 200 16 256 which is a cache directory I think directory size is fixed as 200 MB and what about if the cache is full ? Can I see this directory as well ?
Actually there is a confusion in my mind about cache memory and cache Directory.In general l when we say cache it operating systems it means data which processor keep in its cache area (if i am correct) and pages in ram to minimize work the physical I/O devices to give maximum out but in squid case i am sure it will be different.
Kindly enlighten on my point .
thanks in advance.
garden

xandercage17 01-11-2011 03:46 AM

Delete My account


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