Re: [squid-users] Only 23% of traf is cached. Config problem?
* Andrei funactivit...@gmail.com: refresh_pattern -i \.index.(html|htm)$ 0 40% 10080 refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320 Is this the default? I think that's custom but I'm not sure. Would you recommend changing it and why? I think it's not the default. I personally try to keep the defaults Squid-3.2 has these defaults for refresh_pattern # Add any of your own refresh_pattern entries above these. refresh_pattern ^ftp: 144020% 10080 refresh_pattern ^gopher:14400% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320 cache_dir aufs /var/spool/squid3 7000 16 256 is better. Can you increa the cache size? How does this look? cache_dir aufs /var/spool/squid3 1 16 256 Bigger :) -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebra...@charite.de | http://www.charite.de
Re: [squid-users] Only 23% of traf is cached. Config problem?
* Andrei funactivit...@gmail.com: These are my Squid stats. I have about 23% of cache hits. I have four squid machines, an the Request hit rate average is at: 29.3%, 27.2%, 27.4% and 26.7% (last 24h) So your values could be a bit better. -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebra...@charite.de | http://www.charite.de
Re: [squid-users] Only 23% of traf is cached. Config problem?
* Andrei funactivit...@gmail.com: refresh_pattern -i \.index.(html|htm)$ 0 40% 10080 refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320 Is this the default? cache_dir ufs /var/spool/squid3 7000 16 256 cache_dir aufs /var/spool/squid3 7000 16 256 is better. Can you increa the cache size? -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebra...@charite.de | http://www.charite.de
Re: [squid-users] Only 23% of traf is cached. Config problem?
On Wed, Sep 29, 2010 at 1:43 PM, Ralf Hildebrandt ralf.hildebra...@charite.de wrote: * Andrei funactivit...@gmail.com: These are my Squid stats. I have about 23% of cache hits. I have four squid machines, an the Request hit rate average is at: 29.3%, 27.2%, 27.4% and 26.7% (last 24h) So your values could be a bit better. As the userbase size increases the cache hits will increase. It took literally slightly over 1 million users at the prior site I ran Squid for to get slightly over 50% cache hits. 23% for a small site (300 users) is reasonable, depending on the workload and how much of the sites are all-dynamic content which can't be cached. -- -george william herbert george.herb...@gmail.com
Re: [squid-users] Only 23% of traf is cached. Config problem?
On 09/29/2010 03:47 PM, George Herbert wrote: On Wed, Sep 29, 2010 at 1:43 PM, Ralf Hildebrandt ralf.hildebra...@charite.de wrote: * Andreifunactivit...@gmail.com: These are my Squid stats. I have about 23% of cache hits. I have four squid machines, an the Request hit rate average is at: 29.3%, 27.2%, 27.4% and 26.7% (last 24h) So your values could be a bit better. As the userbase size increases the cache hits will increase. It took literally slightly over 1 million users at the prior site I ran Squid for to get slightly over 50% cache hits. 23% for a small site (300 users) is reasonable, depending on the workload and how much of the sites are all-dynamic content which can't be cached. Dynamic is subjective. What the world considers dynamic most of the is actually dynamically generated static content that rarely changes and always wastes CPU time. I hardly consider one post a day dynamic and unnecessary for sending cache me headers (to squid at least) for the next 24 hours. You can cache all content, dynamic or not, it's just not recommended, you can do it with squid or you can trick squid into thinking it's not dynamic anyways, which is what we do on some our sites for pages that we know rarely change.
Re: [squid-users] Only 23% of traf is cached. Config problem?
On Wed, Sep 29, 2010 at 1:54 PM, Jordon Bedwell jor...@envygeeks.com wrote: On 09/29/2010 03:47 PM, George Herbert wrote: On Wed, Sep 29, 2010 at 1:43 PM, Ralf Hildebrandt ralf.hildebra...@charite.de wrote: * Andreifunactivit...@gmail.com: These are my Squid stats. I have about 23% of cache hits. I have four squid machines, an the Request hit rate average is at: 29.3%, 27.2%, 27.4% and 26.7% (last 24h) So your values could be a bit better. As the userbase size increases the cache hits will increase. It took literally slightly over 1 million users at the prior site I ran Squid for to get slightly over 50% cache hits. 23% for a small site (300 users) is reasonable, depending on the workload and how much of the sites are all-dynamic content which can't be cached. Dynamic is subjective. What the world considers dynamic most of the is actually dynamically generated static content that rarely changes and always wastes CPU time. I hardly consider one post a day dynamic and unnecessary for sending cache me headers (to squid at least) for the next 24 hours. You can cache all content, dynamic or not, it's just not recommended, you can do it with squid or you can trick squid into thinking it's not dynamic anyways, which is what we do on some our sites for pages that we know rarely change. This is HIGHLY content-specific, and in many cases is horridly unsafe. Your mileage may vary. Know what your users are actually doing... -- -george william herbert george.herb...@gmail.com
Re: [squid-users] Only 23% of traf is cached. Config problem?
On 09/29/2010 04:02 PM, George Herbert wrote: Dynamic is subjective. What the world considers dynamic most of the is actually dynamically generated static content that rarely changes and always wastes CPU time. I hardly consider one post a day dynamic and unnecessary for sending cache me headers (to squid at least) for the next 24 hours. You can cache all content, dynamic or not, it's just not recommended, you can do it with squid or you can trick squid into thinking it's not dynamic anyways, which is what we do on some our sites for pages that we know rarely change. This is HIGHLY content-specific, and in many cases is horridly unsafe. Your mileage may vary. Know what your users are actually doing... Oh yes, I highly agree, be careful when you experiment with this type of caching because it can lead to unexpected insecure results. We don't want Jim seeing Janes details after all. To add and to elaborate the dynamic static pages we cache are simply about pages and direct blog archives, everything else we force no caching with headers. I certainly wouldn't personally recommend more than that (and only if they don't have user specific content parts).
Re: [squid-users] Only 23% of traf is cached. Config problem?
Le mercredi 29 septembre 2010 15:39:29, Andrei a écrit : These are my Squid stats. I have about 23% of cache hits. We have 300 users. This is a school environment where most students access the same site at the same time for their classroom activity. Is there anything I should add or change to make the caching better, or is 23% to be expected? Proxy statistics Total amount: requests263,840 Total Bandwidth: Byte2634M Proxy efficiency (HIT [kB/sec] / DIRECT [kB/sec]): factor 5.72 Average speed increase:% 16.58 TCP response time of 100%% requests: msec5048 Cache statistics Total amount cached: requests61936 Request hit rate: % 23.47 Bandwidth savings: Byte454M Bandwidth savings in Percent (Byte hit rate): % 17.24 Average cached object size:Byte7686 Average direct object size:Byte11319 Average object size: Byte10466 Squid box is 2.4 GHz P4, 1GB memory, 40 GB IDE disk. Squid version 3.1.3 on Debian. Config file: acl manager proto cache_object acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl localnet src 176.16.0.0/21 #176.16.0.-176.16.3.254 range acl localnet2 src 192.168.11.0/24 #192.168.11.0-254 range acl localnet3 src 192.168.200.0/24 #192.168.200.0-254 range acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https 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 http_access allow localhost http_access allow localnet http_access allow localnet2 http_access allow localnet3 http_access allow all #not restricted because its behind the firewall and serving local LAN only. I'm just trying to get this working for now... icp_access allow all htcp_access allow all http_port 3128 transparent # ok, transparent proxy, no NATing. Not sure what WPAD/PAC is... hierarchy_stoplist cgi-bin ? access_log /var/log/squid3/access.log squid refresh_pattern ^ftp: 144020% 10080 refresh_pattern ^gopher:14400% 1440 refresh_pattern (cgi-bin|\?)0 0% 0 refresh_pattern . 0 40% 40320 icp_port 3130 coredump_dir /var/spool/squid3 refresh_pattern -i \.index.(html|htm)$ 0 40% 10080 refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320 cache_mgr h...@mydomain.org cache_dir ufs /var/spool/squid3 7000 16 256 visible_hostname gw.mydomain.org You cache is good, i see you are using the default squid configuration so dont worry, 23% is good. According to my master research, a normal cache should cache about 30%. You may play with next options: refresh_patter caceh_policies cache_dir Contact me offline ify ou are more interested :) LD
Re: [squid-users] Only 23% of traf is cached. Config problem?
refresh_pattern -i \.index.(html|htm)$ 0 40% 10080 refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320 Is this the default? I think that's custom but I'm not sure. Would you recommend changing it and why? cache_dir aufs /var/spool/squid3 7000 16 256 is better. Can you increa the cache size? How does this look? cache_dir aufs /var/spool/squid3 1 16 256
Re: [squid-users] Only 23% of traf is cached. Config problem?
On Wed, 29 Sep 2010 13:39:29 -0700, Andrei funactivit...@gmail.com wrote: These are my Squid stats. I have about 23% of cache hits. We have 300 users. This is a school environment where most students access the same site at the same time for their classroom activity. Is there anything I should add or change to make the caching better, or is 23% to be expected? snip access_log /var/log/squid3/access.log squid refresh_pattern ^ftp: 144020% 10080 refresh_pattern ^gopher:14400% 1440 refresh_pattern (cgi-bin|\?)0 0% 0 refresh_pattern . 0 40% 40320 icp_port 3130 coredump_dir /var/spool/squid3 refresh_pattern -i \.index.(html|htm)$ 0 40% 10080 refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320 re-ordering your refresh_patterns so your local ones will work will help things a little. Otherwise as others have said this is fine. The default . and cgi-bin refresh_patterns supplied by Squid MUST be last on the list. Also note the updated syntax of the cgi pattern to prevent early discarding of mis-matched URL: refresh_pattern -i \.index.(html|htm)$ 0 40% 10080 refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320 refresh_pattern ^ftp: 144020% 10080 refresh_pattern ^gopher:14400% 1440 refresh_pattern -i (/cgi-bin/|\?)0 0% 0 refresh_pattern . 0 40% 40320 Amos