Slow home server diagnosis.
January 13, 2016 7:46 PM   Subscribe

Why is there a difference in performance between loading my home wiki directly and loading it via an ssh tunnel?

I have a personal (Mediawiki) wiki I use to keep track of projects, running on an oldish mac mini at home on a crappy ADSL connection. When I'm at home on the LAN, the performance is fine. If I connect to this from the outside world, page loads are painfully slow at best, and time-out at least half the time.

If I SSH tunnel from the outside world to home (to a different machine, incidentally), and then load the wiki as if on the home LAN, performance is perfectly acceptable. I presume this means that the slow server is not the problem, and that (amazingly) the tiny upstream on my home connection is not the problem.

What could cause this, and how can I improve the performance of the site without the tunnel?
posted by pompomtom to Computers & Internet (10 answers total)
 
Are you using gzip compression on the SSH connection and not when serving the website?
posted by Nonsteroidal Anti-Inflammatory Drug at 7:50 PM on January 13, 2016


Response by poster: Would that be enabled by default on the OS X ssh server? I certainly haven't set it up.
posted by pompomtom at 8:02 PM on January 13, 2016


For a while I had a home server that had all sorts of weird interruptions and I traced it down to packet size, if I turned the MTU down to the same size as what the modem could handle, things sped up and got more reliable

Another possibility is that your provider is filtering inbound port 80 http traffic, but can't make head nor tails of the ssh tunnel and leaves it alone.
posted by nickggully at 8:42 PM on January 13, 2016 [1 favorite]


Response by poster: Hmmm... it seems I AM using gzip compression on the tunnel.

Thank you both for the answers, shall now add a new project of "work out mod_gzip"...
posted by pompomtom at 8:51 PM on January 13, 2016


Response by poster: OK, I ticked too soon.

As per this test the wiki pages are being gzipped.
posted by pompomtom at 9:18 PM on January 13, 2016


What happens if you crank down the MTU on the machine you use on the outside?
posted by i_am_joe's_spleen at 11:06 PM on January 13, 2016


Use a performance profiler in your browser to see what is slow. Shift+F5 in Firefox, click Network then reload the page.
posted by gorcha at 1:28 AM on January 14, 2016


Best answer: Any chance your web server is trying to do a reverse DNS lookup on the client (e.g., to enforce domain-based access restrictions) before serving the page?

That could explain why "local" clients get served fast while "outside" clients get served slowly (and inconsistently slowly).
posted by sourcequench at 9:17 AM on January 14, 2016


Compression on a text web page will explain a few hundred milliseconds of difference, not several seconds and timeouts. It's gotta be dropped packets. MTU would be the first place I would look.
posted by zixyer at 10:33 AM on January 14, 2016


Best answer: it is very likely to be timing out on a reverse DNS. this happens for me too.
posted by joshu at 11:08 AM on January 14, 2016 [1 favorite]


« Older muscle memory, don't send me to people.com again   |   Need app: Picture-A-Day on iPhone made into a... Newer »
This thread is closed to new comments.