문제

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

도움이 되었습니까?

해결책 2

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.

다른 팁

There are multiple possible reasons:

  1. Your internet connection with the server is bad sometimes..
  2. Maybe on the same server are hosted other websites that are not well written and is using the processor more...
  3. On the same HOST... the same nameserver? :)
  4. In my country your server is working really good... and I don't see anything that might cause a lag as you describe
  5. Maybe your delay is sometimes bad...
  6. The problem it is not your website :)

Regards

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top