I have an archlinux box with 2 nics as a server/firewall.
It uses shorewall as firewall.
Squid as a transparent cache proxy.
Apache as web server.
MySQL as DB server.
dnsmasq manages the dhcp and dns for the lan.
It hosts phpmyadmin, owncloud and nagios.
All was installed following the wiki.
The firewall was configured using the shorewall 2 interfaces tutorial and the squid with shorewall tutorial.
The squid cache is in a separate ext2 partition close to the beginning of the drive.
The hardware is not an issue, Athlon II X2 255, 2GB 1066MHz DDR3, 500GB SATA2 Hard drive, Onboard 10/100 NIC, PCI 10/100 NIC.
I'm testing this at home with a 6 megabits per second Cablemodem connection, witch assigns a public IP to the server. Followed by a 10/100 Mbps HUB on the LAN side of the server.
The problem is this:
I tested all services and everything works.
But when I tested the squid cache performance I encountered a speed limitation when downloading a file a second time, from the squid cache to a computer on the LAN.
It's actually faster to download from the server on the internet than to download from the server's cache.
The limit is on the 400 kilobytes per second (from the cache on lan). The first time it downloads at 720 kilobytes per second (from internet)
I've posted my confs and wget output on downloading a 20MB file from a very fast and close server (witch is ALWAYS very fast).
I know when the file is downloaded from internet or the cache as I monitor the trafic on the server with nload for each interface and the usage of the squid cache simultaneously.
For better accuracy on this test, I took down the apache server, nagios and the mysql server.
/etc/shorewall/shorewall.conf : http://pastebin.com/adcTeUWd
/etc/shorewall/rules : http://pastebin.com/7JyHzMKc
/etc/squid/squid.conf : http://pastebin.com/HnLyrm4R
test result: http://pastebin.com/HZjiDzJu
Why is this happening?
How can I make downloads from squid cache at LAN speed?
PS: I transfered files to the server with scp at 11 megaBYTES per second.
Last edited by santodelaespada (2012-09-01 04:30:56)
Solved by using ufs instead of diskd in /etc/squid/squid.conf
Long night testing this. I wish it upon no one.
Thanks A lot! This is a lifesaver!
I am running Centos 6.3 - squid-3.1.10-9.el6_3.x86_64
I had exactly the same issue. I switched from diskd to ufs and the problem was solved.
Any ideas for the cause of this?