In the last few months I've noticed that my site is taking a very long time to load.
Firebug tells me that the longest time is waiting
for the response from the server (sometines it just waits for 30s!).
Tha strange thing is that some times it loads fine - within a few milliseconds - even if clear the browser's cache. In fact, it seems to work better when I clear the cache, but just for a few pages, then it starts having these weird 25-second waits again!
And something else: it doesn't seem to do this on other sites hosetd on the same server, like this site or the server's own site!
Does anyone know why it could be doing this?
I'm asking here because it might be a problem with the way I've organized the site.
Thanks!
PS: of course I'd also like you to let me know if it doesn't do it to you! Thanks again

- 3,368
- 7
- 31
- 47
-
PPS: it's not a particularly buisy site either. I haven't got direct access to the server - it's not mine – Sean Bone Feb 20 '12 at 09:53
-
I don't have that problem, loads just fine for me. – Cyclonecode Feb 20 '12 at 09:54
-
@KristerAndersson You might need to click around a while - it doesn't do it to me when I clear the cache either, that's why I think it might be something to do with how I set it up. – Sean Bone Feb 20 '12 at 09:57
-
Firstly, a question like this is more suitable for serverfault.com since it's a systems problem, rather than programming. Secondly, you haven't provided enough information. What language/framework/services are you using for this website? How long does the request take according to your server logs? Provide the results of your own analysis, and the folks on serverfault.com may be able to help you determine the fault. – seanhodges Feb 20 '12 at 10:01
-
@seanhodges Thank you. I'll have to ask my server admins if I can access the server logs, I think. – Sean Bone Feb 20 '12 at 10:19
2 Answers
I think I found what the problem was.
Some pages have dynamic Ajax content updates: after 30s from the page load, the JS on those pages made an Ajax request to a PHP script on the sever, which then looped for a maximum of thirty seconds for any updates that might have to go on the page (messages or posts from users).
Unfortunately, if the user leaves the page while a request is pending, it seems to slow the page changing process down a lot, not exactly sure why.
I think it must have something to do with the way the server is set up, because if I submit a form from a 'slow' page, the script the form submits to executes immediately, so if I cancel the request from the browser while it's waiting, the form has already been processed.
Removing the long Ajax requests from the pages fixed the problem.

- 3,368
- 7
- 31
- 47
There are multiple possible reasons:
- Your internet connection with the server is bad sometimes..
- Maybe on the same server are hosted other websites that are not well written and is using the processor more...
- On the same HOST... the same nameserver? :)
- In my country your server is working really good... and I don't see anything that might cause a lag as you describe
- Maybe your delay is sometimes bad...
- The problem it is not your website :)
Regards

- 2,126
- 3
- 25
- 47
-
3. err... no, I think I ment the web server actually storing the files (LABCC, it's called). Thank you for answering! I'll try it on a few different connections and see if it's just me... otherwise I'll talk to the server administraotrs... – Sean Bone Feb 20 '12 at 10:12