Santity check. Is this even a thing?

Soldato
Joined
18 Aug 2007
Posts
9,916
Location
Liverpool
For a while now this has been driving me a little crazy. Every time I click a link or type an URL and hit enter there's a delay ranging between half a second and up to around three seconds(!) before the page appears and starts loading. I can remember setting up my newly purchased local network equipment (SH3 in modem mode, pfSense machine, PoE switch, UAP AC PRO) and marvelling at how instant page loads were compared to before (when I was using the SH3 as a wifi router as well as a modem). Recently however, I'm becoming more and more aware that this 'lag' is there and I just can't seem to pin it down. Is it a VM internet thing? We recently went from 8 downstream channels to 24, which may be a factor? I say I can't pin it down because I've tried:

Wired (Intel Pro NIC, Realtek onboard NIC, Broadcom NIC) on two separate machines using cat5e and cat6.
Wireless (AC and N clients - Android, iOS and macOS).
Windows 10 Pro x64, macOS Sierra, Debian 9, Manjaro, Solus, FreeBSD, True OS.
Chrome, Safari (macOS), Firefox, Qupzilla, Opera, Vivaldi, Midori and probably more.
No extensions / addons at all (no effect), some extensions (adguard, uBlock origin), everything between.
No antivirus (especially on the *nix OS but also on Windows to be safe).
Changing DNS (from Google to DNS.watch and other combinations).
Changing from unbound to dnsmasq for DNS resolving on my firewall unit, and then back again (also experimented with using no DNS forwarding and letting pfSense directly query root servers).

I even changed my mSATA SSD pfSense install over to an old (about 1 year) IPFire SD Card install which literally hasn't been touched since I switched over to pfSense. As such it's the very definition of 'last known good config' as (1) it's an SD Card that hasn't seen power in a year and (2) obviously hasn't had its config changed or received any updates since then - and when I did last use it my page loads / response to entering URLs were loltastic fast.

So... I'm runing out of ideas. And sanity. :D Does anyone have any thoughts or ideas about this? I'm starting to consider it's probably just a VM thing. Our area is pretty rock solid now, since the network capacity upgrades. I get 220/22 (actual figures) absolutely flawlessly 24/7 with no peak slowdowns or other issues. So I'm wondering, as I said, whether it's just 'a VM thing' made worse by the downstream channel increase from 8 to 24? I know in the past I've read people mention how FTTC might be 'slower' in headline speed but the low pings and fast responsive nature of the web makes it worth it. Is this one of the things they meant?

I thought at first it might be slight latency in the AP Pro (I tend to use my MacBook Pro for surfing and wired clents for servers), but having tried many variations of wired connections too it's still there. About the only thing I haven't tried yet - because it'd be a pain - is turning the SH3 back into router mode and bypassing everything else in my local network. Given that I bought all my network stuff precisely because of lags like this using the SH3 it's probably not going to make any difference though! Any ideas? :o
 
Obviously test with the cleanest wired connection you can.

Briefly dropping the SH3 back into router mode and testing with a single wired client would make a lot of sense. It wouldn't be difficult, just unplug the rest of the network from the SH3 for the few minutes it'd take.

In Chrome I'd hit F12 and then select Network. If you then open/refresh a webpage you'll be able to see everything that happens and the time involved for each step.
 
I'll definitely do that to be thorough, but your idea to use Dev Tools may actually have given me a surprising answer: Perception.

With my completely n00b expert eye I found no glaring issues except OcUK's forum front page constantly trying to load navigation-tab.png (which is 404, and is the slowest item on the page to try to load), and something about 'XenForo uBlock Origin detector' being loaded by the page (wut?!).

I then started thinking about the displayed DOMContentLoaded time versus total page load times, and had an idea. I decided to stop watching the Dev Tools sidebar and focus on the actual web page side instead, before checking the results. I'd previously disabled Chrome's cache by ticking the box in DevTools to try to make things fair (not much point checking a page you already hold in cache).

Forum homepage - 2s perceived lag between my click/request and the page starting to load.
Techspot - 1s perceived lag.
TheVerge - 3s perceived lag.

Strangely, having looked to the right each time the DOMContentLoaded time matched exactly with the perceived 'lag'! Of course modern browsers tend to load the 'bones' of a page in the background and then display it all at once to 'speed up' perceived loads. My brain seems to be broken and working backwards. I guess on older browsers I was used to seeing a 'page' start loading instantly, and the pesky heavy bits would fill in a second or two later as it downloaded.

Hence, 'instant' page loads after making a click or pressing enter on the URL bar in the past. Now, I hit enter or click a link and there's a 'lag' while the browser pre-grabs the frame of the page and loads it 'instantly' (i.e. all at once) and I'm seeing that as lag.

Maybe. Maybe I just need sleep. Does this sound ridiculous? It does seem strange my 'lag' count tallies exactly with the DOMContent load times across multiple sites, time after time after time. I can see from the DevTools that when I click or hit enter Chrome actually gets to work instantly, where I previously thought it was 'waiting' for something before rushing off to start loading the page. So maybe I'm not so wrong...
 
Last edited:
When I was on VM I found changing my DNS servers was an absolute godsend.

It looks like you've tried it already but I'd suggest switching to the VM ones and looking at your trace logs in Chrome to see the difference.

I was getting a good 2 or 3 second delay with VM DNS servers on a good day. On a bad day half the time they wouldn't resolve Google in less than 30 seconds.

Remember that DNS caching is something that might have skewed your perception of whether the change worked. If you change your DNS servers but don't actually flush the cache then you're likely still using the old ones for a couple of hours!
 
You should.

Not one to keep posting needlessly, I went away and tried as you suggested. No difference. A few days of testing later and I've fixed it (touch wood!). I changed pfSense to use unbound/resolver without forwarding - i.e. no third party DNS server at all. I'm now fully running my local DNS server with an SSD cache. Now I know my DNS latency is minimal (after caching) and I'm still having the same issue. More testing... Long story short, Adguard was the culprit. It had installed to all browsers via sync, and even when disabled it had installed its own certificates and network hooks so I can only imagine they were still inline somewhere/somehow.

I fully removed all instances of Adguard, and then went back to uBlock Origin (with Protector + Extra extensions in Chromium based browsers). After an hour on their Wiki to really learn how to use it I enabled advanced mode; and then set disable remote fonts globally, disable 3rd party frames globally (with an exception for youtube to enable embeds), disable hyperlink auditing and disable WebRTC. Locked and loaded.

I now have super snappy browsing again on Windows, macOS, BSD and Linux! The pages mentioned above (this forum, Techspot, Verge) have gone from multi-second delays to loading before I've even finished hitting enter, and fast.com and other speed tests are now showing 380Mbps. Sorted. :cool:
 
Back
Top Bottom