Results 1 to 14 of 14
  1. #1

    Why is there always a delay when people connect to my web server?

    Hello,

    (This is a problem that has been bugging me for years now, and I still haven't found the solution. I practically gave up, but I want to give it one last try on this forum.)

    I have my own small dedicated web server for years now. It is running a version of Ubuntu Server Edition and Apache 2 (I keep everything up-to-date). On this server I host several websites, six or so. I pay a hosting company (DreamHost) for domain names, and I use their DNS server to forward domain names to my server's public IP address. So far this all works fine, people from around the world can access the web sites hosted on this server.

    Now this is the problem I have. Whenever people enter the website's address in their browser, and they hit the Enter button, the website doesn't load. You can wait like a minute or so until the browser finally gives up. But if you try that a second time, the website will load immediately (and will continue to respond fast). In fact, during the first attempt, you don't have to wait for the browser to give up - when you hit Enter, just wait 5 seconds, hit the browser's Stop button, and then hit Enter again, and the website will load immediately.

    I don't have this problem if I access one of my websites locally (from within the same local network), which means that it is not an issue with the web server or Apache. I also don't have this problem from some external locations. For example, if I access my website from my university, it will load immediately. But from most other locations I have tried, I have the above described problem.

    Another interesting fact. My webserver has SSH access, and this problem does not seem to occur when I access my webserver via SSH.

    Does anyone reading this have an idea of what could be going on here? What could I try to troubleshoot this problem?

    P.S. By the way, this is my server: byobu.info. You could try to connect and see for yourself.
    Last edited by figure002; 02-12-2014 at 11:16 AM. Reason: Fixed typo

  2. #2
    Join Date
    Jun 2010
    Location
    Grand Rapids, Mi
    Posts
    712
    Are you hosting this at home? If so, it is likely that your path to the internet is not the best, or your upload speed is not fast enough. You want the least amount of hops possible (be close to a "main pipeline")
    Stream101 | Affordable Media Solutions
    Shared cPanelŽ Web Hosting | WordPress Hosting | Premium Stream Hosting
    TOLL-FREE: (616) 277-7280 | 30 Day NO QUESTIONS Money-Back Guarantee
    100% Cogent Free Network | CloudLinux OS | Tier 1 Bandwidth | Grand Rapids, MI

  3. #3
    Hello,

    Maybe you need to reboot the server, always works for me, but yet again if your hosting it from home it could be an issue.

    In the end, whenever I reboot my server it works just like it did when I bought it.


    Thanks,
    Matt
    <<signature to be set up in profile>>
    Last edited by Postbox; 02-12-2014 at 12:21 PM.

  4. #4
    Quote Originally Posted by Matt AH View Post
    Maybe you need to reboot the server, always works for me, but yet again if your hosting it from home it could be an issue.
    Hi Matt, thanks for your reply. That's not the issue however. As I explained in my post, the server itself is responding fine when accessed locally, always. Also note that I am running GNU/Linux on my server, so rebooting is hardly ever necessary, unless there's a core component that needs to be updated (e.g. the Linux kernel).

    I think it's a connection related issue (DNS maybe?).

  5. #5
    Quote Originally Posted by Stream101 View Post
    Are you hosting this at home? If so, it is likely that your path to the internet is not the best, or your upload speed is not fast enough. You want the least amount of hops possible (be close to a "main pipeline")
    Thanks for your reply Stream101. Yes, I am hosting this at home. I just contacted my ISP and they said that my connection is good, in fact, better than it is for most of their clients. So I think it's safe to rule out upload speed.

    I was actually thinking in the same direction, in terms of "path" to the internet. With "hops", are you referring to DNS servers? I was thinking that maybe it's an issue with one of the DNS servers that is in the path to the internet. How can I figure out the amount of hops? And how could I reduce them?

  6. #6
    Join Date
    Oct 2010
    Posts
    5,079
    Get a visitor to your site to run tracert or mtr from their machine to your home server. Paste the results here.
    Not as active on WHT as I used to be, but still drop in and receive email notifications from here.
    My personal blog site: https://www.oakleys.org.uk/blog

  7. #7
    Join Date
    Oct 2010
    Posts
    5,079
    Update - it almost certainly isn't the number of hops from them to your server, however.

    Have a look at this.

    You've got a 5.54 second delay in the "Wait" stage of the process. That's after the visitor has found your server's IP, after they've connected to it, after they've sent it a request for the web page - but while they wait for the answer. So your server spent 5 seconds assembling the web page to return.

    Having done that, you'll see from the waterfall that the other resources (CSS and the like) all came fairly quickly.

    I'd guess that the main page takes the server some time to put together? Is it PHP / MySQL or similar? But it's definitely your server that is taking the time.
    Not as active on WHT as I used to be, but still drop in and receive email notifications from here.
    My personal blog site: https://www.oakleys.org.uk/blog

  8. #8
    Quote Originally Posted by OakHosting_James View Post
    Update - it almost certainly isn't the number of hops from them to your server, however.

    ...

    I'd guess that the main page takes the server some time to put together? Is it PHP / MySQL or similar? But it's definitely your server that is taking the time.
    Thanks for your reply James. Actually, the pages on byobu.info are all static HTML pages, but as you can see from Pingdom's output, there's a Javascript that accesses a PHP script for visitor tracking. But I took extra measures to cache pages on the server, to improve responsiveness.

    Even though a 5 seconds delay is a little long, I would be fine with that (as long as it stays under 6 seconds). But when people access byobu.info for *the first time*, the web page won't load at all! That's what's bugging me. They have to try a second time (hit refresh) before the page will load.

    On the other hand, there is almost no delay when I access any of my hosted websites locally. I hit Enter button, and the web page loads immediately (even when browser cache is cleared).

    Something else must be going on here.

    By the way, here's the live traceroute output: network-tools.com/default.asp?prog=trace&host=byobu.info

  9. #9
    Join Date
    Jan 2010
    Location
    USA
    Posts
    2,173
    Are you logging with reverse DNS enabled? If you are, then some users would load quickly while other users got stuck in the wait phase (while the reverse DNS lookup was performed).
    No Support Linux Hosting Bargain cPanel Hosting Experts Only
    We IGNORE the support questions, and pass the SAVINGS on to YOU!
    We also ignore questions about VPS Hosting

  10. #10
    Join Date
    Jun 2005
    Posts
    3,455
    What kind of router or model is your server connected behind?

    This could be the problem, assuming its not indeed your ISP connection, if you use a cheap home router, this could be hanging while trying to process the request, since they are not actually designed for web servers, this means connections coming in rather than out.

    If you use a very cheap 40$ router this could explain why locally you are hitting them fast, but not from outside. It may be worth checking with another device.

  11. #11
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    503
    I've just visited your website and didn't experience this problem, loaded up first time under 1 second.

  12. #12
    Join Date
    Feb 2003
    Location
    Albany, New York
    Posts
    3,026
    About a 1 second load time for me.

  13. Loads quickly... BTW the delayed response is caused by the internet connection. At your home, you can't expect a good performance from your Internet connection, it doesn't matter what your ISP says. Think about hosting providers, their connections' speed is extremely good and the connection is dedicated for serving websites. On the other hand, your ISP is providing the Internet connection for common people that mostly use it to browse the Internet.

  14. #14
    Join Date
    Dec 2013
    Posts
    5
    Whenever the issue occurs, you may also want to check a few things :

    - Apache Status - Is there some apache slots available ?

    You may have a huge spike of traffic which is saturating your apache workers.

    - Load average - type top as SSH command.

    Does it exceed your number of threads which could cause a waiting queue for processes to be executed
    You seem to have a static website so there isn't much for the server to do to display your website.

    But these 2 steps are a good starting points to troubleshot any slow loading time issues.

    You can also install iftop to monitor your current bandwidth usage and see if there any saturation.

Similar Threads

  1. Some people cannot connect to website via domain
    By Geepeez in forum Domain Names
    Replies: 4
    Last Post: 04-04-2011, 05:23 AM
  2. server loading delay
    By FarzinSB in forum Dedicated Server
    Replies: 10
    Last Post: 03-21-2010, 06:37 AM
  3. Turn Off back connect From Web Server
    By tkanaco in forum Hosting Security and Technology
    Replies: 0
    Last Post: 08-07-2008, 05:26 AM
  4. 20% of people unable to connect to my site
    By BornMunson in forum Hosting Security and Technology
    Replies: 5
    Last Post: 09-27-2007, 09:15 PM
  5. If I Own A Web Server How I Do To Connect It!!
    By mickeycuba in forum Dedicated Server
    Replies: 6
    Last Post: 11-18-2002, 04:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •