Conclusion of Optimize Squid for Reverse Proxy:
After having read and tested the guides from the articles, I got some tips on the topic:
- recompile the squid if you can, tuning the compile parameters.
#ulimit -n8192 (system setting)
./configure … –with-filedescriptors=8192 …
of course the 8192 is just my parameters. if your hardware is more powerful, just increase it to handle more concurrence requests. the max is 65535
cache_mem = 70-90% physical memory #if your server just for squid
maximum_object_size 1024KB #we just cache some small things just as js/css/jpg/gif.
#aufs is for async-io, offload disk reads to a thread. big cache is always good.
cache_dir aufs /var/spool/squid 50000 16 256
#cache_dir ufs Directory-Name Mbytes L1 L2 [options] L1 means 16 subdirectories L2 means 256 subdirecotries. if you don’t have good reason, just leave it.
#don’t cache 404’s, always go to origin servers
negative_ttl 0 minutes
#ignore the store logs
set a individual partition for cache disk.
suggest to choose reiserfs file system.
mount -t defaults,noatime # esp noatime