Slow DNS w/Squid - Fix
-
Hi all,
I just discoverd a "fix" for a "slow-laggy" DNS issue we were having, and thought it might be a good post for the forum.
I didn't know weather to post it here or in the DNS forum..but I feel the packages are probably a better fit.pfSense:
1.2.3-RELEASE
built on Sun Dec 6 23:21:36 EST 2009
Kernel Version FreeBSD 7.2-RELEASE-p5 #0 Sun Dec 6 23:20Backup
Cron
Lightsquid
bandwidthd
darkstat
iperf
nmap
ntop
phpSysInfo
rate
snort
SquidHardware:
Processors 1
Model Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
CPU Speed 2.99 GHzThe issue we were having was a rather slow initial loading of web pages when going through the Squid proxy (10-15 seconds). Once the users were at a domain, the pages within that domain loaded fine, and at a "regular" speed.
We discovered that the slowness in this initial load went away as soon as we entered our DNS server info in the "Use alternate DNS-servers for the proxy-server" field.
These were the same DNS servers that were entered in our System > General Setup area.
Having them entered in the Squid config, seems to have made a huge difference (in a good way) in the initial loading of web pages.-Scott Owen
-
for troubleshooting issues with squid, looking at the output from squid using the squid manager info screen to be invaluable. From the command line you can do something like:
#squidclient -p 3127 mgr:info
This will show you, among many other tasty squid-related treats, the various amount of time different parts of the squid request took. If you find DNS resolution taking an obscene amount of time, then your troubleshooting task is already mostly done.