30 seconds to initial response: Wordpress/Apache on Linux VPS

Discussion in 'Apache' started by gorrillamcd, Oct 17, 2013.

  1. #1
    I need some help with a performance issue that I can't seem to find the answer to.

    The title says it all. My site will wait for 30s almost everytime before loading any of the page itself. I've found a few other instances of this problem on google, but no solutions.

    Specs of my install:
    - DigitalOcean Droplet (VPS) with Ubuntu Server 12.10: 512 Ram and 20GB SSD (not even coming close to needing more RAM, still have 240MB free according to top)
    - Wordpress 3.6.1
    - 5 plugins: W3 Total Cache, Wordpress SEO by yoast, WP Better Security, WP Smush.it, and Redirection (problem occured before adding the last 2, I can't remember about the others)
    - No traffic to speak of. I get maybe 10 uniques/day.
    - Apache 2.2.22
    - MySQL 5.5.32

    I've optimized my site itself the best I can, minifying and combine js and css files, using the WP Smush.it plugin to compress images, serving jQuery from a CDN, but none of that helped the 30 second wait (though it did shave about 10 seconds off the load time after the wait for response).

    What are some things that might be causing this? I was using cloudflare and had to fiddle with the nameservers of my domain, but cloudflare didn't help at all and I switched the nameservers back to normal pointing DNS directly at my site to help eliminate the obvious causes.

    I'm pretty convinced it's a server problem. I'm comfortable with Linux and the command line so fire away with your suggestions please! If you need more info, let me know. This is the link to my site: http://thematicnet.com
     
    gorrillamcd, Oct 17, 2013 IP
  2. gorrillamcd

    gorrillamcd Member

    Messages:
    43
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    38
    #2
    Well, I enabled NewRelic on my server to see if I could nail down where the error is. It not the database as all calls to that are much less than 0.5 seconds. It's not apache either since I ran strace on my apache instance apache is making lots of wait4() calls, which, I assume, means that it's waiting for something else to finish? That leaves php and NewRelic seems to agree.

    I can't do transaction tracing since it cost money that I don't have to upgrade to NewRelic Pro. I'll continue trying to track down the problem, but if you guys have any input, I'd very much appreciate it.
     
    gorrillamcd, Oct 17, 2013 IP
  3. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #3
    Please test it using a simple html file, if it loads immediately it would mean that it is problem with
    your website setting, coding, etc.
     
    it career, Oct 18, 2013 IP
  4. gorrillamcd

    gorrillamcd Member

    Messages:
    43
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    38
    #4
    Well, @it career you're right. It was a problem with the theme I purchased. I enabled NewRelic on my site and got the Pro trial version so that I could do transaction tracing. I know, it's the long way around the problem, but it worked. Turns out there's a social widget on my theme that makes a call to wp_http_request which is what takes 30s to complete. I disabled it and things are running smoothly again.

    To everyone else with a wordpress problem: It's not enough to disable your plugins to narrow down where the problem is coming from. You also need to check that the theme is not causing the problem by switching to the default theme. If the problem goes away, you know something in your theme caused it and you can narrow it down from there.
     
    gorrillamcd, Oct 18, 2013 IP