Tim F
Tim F

Reputation: 13

Sometimes pages on my website load very slowly

Across all browsers/devices, I find random different pages, at random times, are very slow to load/don't load. The browser is stuck on 'Waiting for website.com'. I will wait 20 seconds and nothing will happen until I manually refresh the page. As I realise this is very vague, can you suggest a) most likely issues to look for first or b) some diagnostic tools that I could use to try and de-bug the issue as a starting point, so that my hosts/developers can solve the issue. Here are some results of recent speed tests.

One thing to also add is that, it seems it more often gets stuck on particular pages. Namely the pages where users take practice tests. After each time the user clicks 'Next', their selected answer is inserted into the database. My speculation is that potentially it's an issue with the DB itself, or the process which inserts into the database. It's when clicking 'Next', that the whole website sometimes just dies as described above.

Results from Google Speed Test

Waterfall image

Upvotes: 0

Views: 1213

Answers (2)

Misunderstood
Misunderstood

Reputation: 5661

You need to run a few page speed tests and look at the waterfall images.

It is very common on shared servers for the server to be too busy to get to your request. 20 seconds would indicate a serious issue with the server.

Another common reason is the page has a link to a third party resource and that resource is too often unavailable.

In your case the culprit is website.com and I assume that is your site.

Use something like webpagetest.org to run the tests.

In the waterfall image below
Dark Green is DNS lookup time.
Orange is the time for Browser to connect to server.
Green is the wait time for server to put image in output buffer.
Blue is the time for the server to transmit to the Browser.

The problem with the sample waterfall page is the index page took 4 seconds to be generated or retrieved. Most likely this is a Word Press site with plugins.

I suspect yours may be 20 seconds. But due to the randomness, is is also a good possibility it is a page resource that is stalled.

If it is the index page, then you likely have a poor ISP and or one of the other users of the server is hogging the CPU.

Keep running the tests until you see the problem occur.

It will be very obvious where the problem is located.

You can post the waterfall image and send me a message if you have any questions.

Waterfall from webpagetest.org

enter image description here

Upvotes: 0

Gerald Mücke
Gerald Mücke

Reputation: 11132

A wait time of 20secs at random times and random pages could possibly be due to stop-the-world garbage collection. So GC logs are probably a good starting point.

A thread sampler such as Djigger a colleague of mine wrote might probably also help you figuring out what the machine is doing during the 20 seconds.

If that doesn't help I suggest to use a Profiler or better an APM tool to monitor whats going on on your system. Those tools give a you a broader insight of the internals.

Upvotes: 1

Related Questions