1

I got handed an issue to look at where a sites pages were loading exceptionally slowly - we're talking 13 to 20 seconds. The site is obviously customised with various addons. I did some digging into it and did the normal debug enable and checked the profile which showed some slowness in various areas but none of which totalled the full page load time. In fact some page scan tools - Google amongst them - didn't properly recognise the slowness just claiming the page loaded in about 4 seconds or so (same as the profile).

Slightly stumped I dug into it further and then found the problem using telnet. Here is an example of what I got.

Firstly, I used a completely basic GET request, ie:

GET / HTTP/1.1
Host: www.slowsite.somewhere

Here's the output example:

HTTP/1.1 200 OK
Date: Mon, 03 Nov 2014 09:22:13 GMT
Server: Apache/2.4.9 (Unix)
X-Powered-By: PHP/5.3.28
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: no-cache
Pragma: no-cache
Set-Cookie: f3c945355423e6c96228179d74322888=tbh278qicf0cle0j8nc5pf0fu3; path=/; HttpOnly
Vary: Accept-Encoding,User-Agent
Cache-Control: max-age=2592000
Expires: Wed, 03 Dec 2014 09:22:13 GMT
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

702a
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr"><head><base href="http://XXXXXXXXXXXX/" /><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta name="generator" content="Joomla! - Open Source Content Management" /><title>Home</title><link href="http://XXXXXXXXXXX/?view=featured" rel="canonical" /><link href="/?format=feed&amp;type=rss" rel="alternate" type="application/rss+xml" title="RSS 2.0" /><link href="/?format=feed&amp;type=atom" rel="alternate" type="application/atom+xml" title="Atom 1.0" /><link href="/templates/XXXXXXXXX/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /><link rel="stylesheet" href="/components/com_rsform/assets/calendar/calendar.css" type="text/css" /><link rel="stylesheet" href="/components/com_rsform/assets/css/front.css" type="text/css" /><link rel="stylesheet" type="text/css" href="/plugins/system/jch_optimize/assets2/jscss.php?f=953dd117283665c8de4b1dbc99fa7ebc&amp;type=css&amp;gz=gz&amp;d=30&amp;i=0"/><link rel="stylesheet" href="/modules/mod_slideshowck/themes/default/css/camera.css"

then down at the end...

<div class="footer3">© 2014 XXXXXXXXXXX. All rights reserved</div><div class="clear">&nbsp;</div><div class="footer-bottom">Company Name: XXXXXXXXXX. Company Registration No/Place of Registration: XXXXXXXXX Cardiff Registered Office Address: XXXXXXX</div></div></div></div></div></body></html>
0

As you can see, there is some text outside the HTML. It looks like some sort of debugging hex word output. The first one changes all the time (eg 7139, 6fc3) but the last one at the end is 0 all the time.

I'm hoping this rings a bell with somebody who's seen this before?

If not I'll have to go dig into this - never used Joomla and PHP very rusty since I last programmed with it many years ago.

Interesting aside is that if you view page source in a browser (Chrome, Explorer etc) they don't show this extra data at all. Totally invisible. It's only if you telnet to the site that you see it.

Then also interesting is that probably the trailing <newline>0<newline> after the </html> seems to make the browser think there is more data coming, and it doesn't try to render the page until the default HTTP 1.1 keepalive times out and it drops the connection. It is only then that the browser requests the CSS, Javascript, Images etc. This visible from the timeline/waterfall graph such as eg tools.pingdom.com and gtmetrix.com.

For reference but probably irrelevant the site is hosted with http://www.heartinternet.co.uk/ who we've used for the last 7 years and found quite reliable and with good performance, though never had a Joomla site on it (this was developed somewhere else)

2
  • 1
    Have you tried taking a backup of the site and trying to run it on your localhost? This would always be step 1 for me
    – Lodder
    Nov 5, 2014 at 10:24
  • if you didn't find any slow executing query, then most probably a js, other external file, or a not-found file, must be slowing down the website.
    – FFrewin
    Nov 5, 2014 at 18:33

2 Answers 2

2

Note that your Telnet's Transfer Encoding is chunked. So that 7139 means 28985 bytes received or 702a means 28714 bytes received.

Don't worry about it. The delay is due to somewhere else.

4
  • Thanks, I'll check into that and come back by latest early next week. Nov 6, 2014 at 9:39
  • No problem. Please be informed that you can use GET / HTTP/1.0 instead of GET / HTTP/1.1 or use curl instead of telnet.
    – Farahmand
    Nov 6, 2014 at 10:59
  • I had a few minutes so had a quick look at it again. The problem is still there, but it's not caused by anything I've outlined in my question - and this answer covers the title of the question so closing this and will try a new question. Probably with a more suitable heading trying to summarise "Site takes 22 seconds to load, claims initial get has 16.10s 'waiting' time, but telnet & curl tests complete in 5s". Lol wish me luck in getting a short intelligible heading :-) Thanks for the good answer. Nov 6, 2014 at 11:40
  • You're welcome! You may consider screenshots of pingdom and gtmetrix results or, even better, add the website address in your new question. Good luck!
    – Farahmand
    Nov 6, 2014 at 13:29
2

Some third-party plugin may be generating the zero.

  • It is not a module or component output, because it should be included in the html
  • Since zero is generated after the Html, it is rendered before Joomla ends the execution, for example closing sessions.

I would disable, one by one, all non-core plugins (and everything else) to discover the cause.

1
  • I'll dig into that once I've found the cause of the load time discrepancy Anibal. There is some major issue somewhere that isn't making sense to me yet. Once I've got it down to a semi acceptable response time I will most certainly dig into the plugins to find out how to speed it up even more. Right now I'm trying to find a missing 17 seconds in the load time. Nov 6, 2014 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.