Squid makes Internet slow

PROXYsquidubuntu-12.04

I have configure squid proxy in our network on ubuntu server. All the traffic being divert to proxy server by Mikrotik router. After I configure squid proxy I changed /etc/squid3/squid.conf as

http_port 8080  #changed from default port 3128
/var/log/squid3/access.log #uncomment access log
variable_hostname myproxy #added
http_access allow all  #added

I have added following lines to squid.conf to make squid highly anonymous

forwarded_for transparent
header_access Allow allow all
header_access Authorization allow all
header_access Cache-Control allow all
header_access Content-Encoding allow all
header_access Content-Length allow all
header_access Content-Type allow all
header_access Date allow all
header_access Expires allow all
header_access Host allow all
header_access If-Modified-Since allow all
header_access Last-Modified allow all
header_access Location allow all
header_access Pragma allow all
header_access Accept allow all
#header_access Accept-Enncoding allow all
header_access Accept-Language allow all
header_access Content-Language allow all
header_access Mime-Version allow all
header_access Cookie allow all
header_access Set_Cookie allow all
header_access Retry-After allow all
header_access Title allow all
header_access Connection allow all
header_access Proxy-Connection allow all
header_access All deny all
header_replace User-Agent anonymous

Now internet connection for our network is very slow. The moment I disable the rule which divert all traffic to squid proxy server we get faster internet. How can I make squid proxy server very fast.

Additional Info

OS: Ubuntu server 12.04.
RAM: 512 MB.
HardDisk: 80 GB.
Processor: Pentium 4.
Squid: version 3.1.19

I didn't configure cache in squid to make internet fast but no use.

Best Answer

The server looks like old piece of hardware. For HTTP proxy it is necessary to tune your setup this way:

  • Make sure DNS resolves fast on your squid system (try "host www.google.com", make sure you have fast DNS servers - you can setup Google fast DNS: 8.8.8.8 and 8.8.4.4)
  • Calculate how much memory to use for caching: http://wiki.squid-cache.org/SquidFaq/SquidMemory
  • Make sure your server is not swapping.
  • Put your disk cache onto separate partition dedicated only to the disk cache and nothing else (this is important).
  • Choose proper filesystem for the cache (I recommend ext4 with dir_index option!)
  • Tune your disk cache setting: http://www.squid-cache.org/Doc/config/cache_dir/ (very important - depends on the size and expected files there - are they big or small?)
  • Monitor your server and make tunings over time (you can't achieve perfect setup the first day - you need to revisit your setting after while when cache fills up).
Related Topic