In the Linux environment with AUFS type of cache_dir more stable, faster. Cache_dir file system If you use the Noatime option to mount, you can avoid
The operation of access time is frequently updated when accessing cache files.
The ratio between general cache capacity and accelerated content is appropriate at 1:10 to 1:20.
Cache_dir Aufs/var/spool/squid 10240 64 64
This is a typical Web site Web caching server Cache_dir configuration that accelerates content from 100GB to 200GB
Cache_dir Aufs/var/spool/squid 1024 16 64
This is a typical office transparent agent Cache_dir configuration, accelerated 10GB to 20GB content
2.cache_mem
Many articles say cache_mem to be set to half the amount of physical memory, such as physical memory 2GB Cache_mem to set to 1GB. But after the actual use of the test, which often
Is the culprit that causes server memory overload. "Squid:the Definitive Guide" about Cache_mem said: "This directive doesn ' t
Entirely control the size of the Squid process. In actual use, memory usage tends to exceed cache_mem limits, that is to say,
The amount of squid consumed does not seem to be controlled by this parameter. Therefore, this parameter does not need to set too large, the right amount on the line, my settings are:
Server:
Cache_mem MB
Lan:
Cache_mem MB
In addition, setting a smaller maximum_object_size_in_memory value helps to effectively control squid excess memory, for example:
Maximum_object_size 12288 KB
Maximum_object_size_in_memory KB
Memory_pools off is also a good setting
On the other, personally feel squid this software design of the failure of the place is memory management this piece ...
3. Transparent Agent
The firewall is set up for port blocking, and then this setting enables transparent proxies:
Httpd_accel_port 80 (0: Speed any port)
Httpd_accel_host Virtual
Httpd_accel_uses_host_header on
Httpd_accel_with_proxy on
This is to make two modes of work: Agent mode and Acceleration mode, while working. To turn off proxy mode, simply set the httpd_accel_with_proxy to OFF
4.http_port
Http_port can be set repeatedly to allow squid to listen on multiple ports
When set, this option makes Squid transform a request with a No-cache directive into a validation
(if-modified-since) Request. In other words, Squid adds a if-modified-since header to the request
Before forwarding it on. This is only works for objects that have a last-modified timestamp.
The outbound request retains the No-cache directive, so that it reaches the origin server.
The meaning is: only on the source server file changes in the actual situation to update the cache content.
Tip: Ctrl+f5 can force browsers and squid to refresh its cache.
Digression: Content Management System (CMS) in the Update release page, should have a communication mechanism with the cache server, notify cache refresh updated content
7. Miscellaneous
Negative_ttl 0 Minutes
Pipeline_prefetch on (helps with the speed at which the boost Squid handles client requests)
Forwarded_for on
Dns_nameservers 202.96.128.86 202.96.128.166
8.squid+apache
Squid in the Apache server can effectively reduce the number of Apache derivative processes, thereby reducing memory consumption.
Using Squid's access control function, it can realize the function of content filtering, connection limit and so on that Apache power can't.
Squid I/O-driven request processing mode, more efficient implementation of static content request processing, as for dynamic content or to Apache to deal with.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.