2011/8/18 Amos Jeffries <squid3@xxxxxxxxxxxxx>: > On 18/08/11 19:40, Drunkard Zhang wrote: >> >> 2011/8/18 Chen Bangzhong: >>> >>> My cached objects will expire after 10 minutes. >>> >>> Cache-Control:max-age=600 >> >> Static content like pictures should cache longer, like 1 day, 86400. > > Could also be a whole year. If you control the origin website, set caching > times as large as reasonably possible for each object. With revalidate > settings relevant to its likely replacement needs. And always send a correct > ETag. > > With those details Squid and other caches will take care of reducing caching > times to suit the network and disk needs and updates/revalidation to suit > your needs. So please set it large. > >> >>> I don't know why there are so many disk writes and there are so many >>> objects on disk. > > All traffic goes through either RAM cache or if its bigger than > maximum_object_size_in_memory will go through disks. > > From that info report ~60% of your traffic bytes are MISS responses. A large > portion of that MISS traffic is likely not storable, so will be written to > cache then discarded immediately. Squid is overall mostly-write with its > disk behaviour. Will a "cache deny" matching those non-storable objects suppress storing them to disk? And HTTP header 'Cache-Control: no-store' ? > > Likely your 10-minute age is affecting this in a big way. The cache will > have a lot of storable object which are stale. Next request they will be > fetched into memory, then replaced by a revalidation REFRESH (near-HIT) > response, which writes new data back to disk later. > >>> >>> In addtion, Disk hits as % of hit requests: 5min: 1.6%, 60min: 1.9% >>> is very low. >> >> Maybe cause by disk read timeout. You used too much disk space, you >> can shrink it a little by a little, until disk busy percentage reduced >> to 80% or lower. > > Your Squid version is one which will promote HIT objects from disk and > service repeat HITs from memory. Which reducing that disk-hit % a lot more > than earlier squid versions would show it as. > >> >>> Can I increase the cache_mem? or not use disk cache at all? >> >> I used all memory I can use :-) > > Indeed, the more the merrier. Unless it is swapping under high load. If that > happens Squid speed goes terrible almost immediately. > > Amos > -- > Please be using > Current Stable Squid 2.7.STABLE9 or 3.1.14 > Beta testers wanted for 3.2.0.10 > Thanks, Kaiwang