Need to troubleshoot slow Wordpress Install

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Need to troubleshoot slow Wordpress Install

Postposted on Wed Jul 17, 2013 8:20 pm

My blog, http://ritchan.dasaku.net, takes a long time to respond to a HTTP request. Inserting <?php echo get_num_queries() ?> and <?php timer_stop(1) ?> into the footer gets me:
Code: Select all
<div id="footer">
<!-- 2 queries. 0.987 seconds. -->
<!-- Page generated on Thursday 18th of July 2013 01:12:42 AM UTC -->
</div>


But as a whole, the server takes more like 40 seconds to respond. This doesn't happen in the wp-admin pages. What could be going wrong here? Is there something that can tell me what Wordpress is spending its time on? I disabled all plugins already (and used WP-Optimize).
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
Crayon Shin Chan
Minister of Gerbil Affairs
 
Posts: 2253
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia

Re: Need to troubleshoot slow Wordpress Install

Postposted on Wed Jul 17, 2013 9:40 pm

Hmm... main page loads very quickly, so it is definitely not server load. I see the long delay if I click the links to any of the individual posts.

Maybe it is stuck waiting for something else to time out, like a DNS lookup?
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 38123
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Need to troubleshoot slow Wordpress Install

Postposted on Thu Jul 18, 2013 12:14 am

First time loading was slow, really slow. Second pc, it loaded instantly (this is after the first one loaded it really slow).
I7 3820, 16 GB of ram, 240 gig corsiar nuetron, gtx 560 ti, asus x79 ws, HP ZR24w
128 GB surface pro
thecoldanddarkone
Minister of Gerbil Affairs
 
Posts: 2237
Joined: Wed Mar 26, 2003 4:35 pm

Re: Need to troubleshoot slow Wordpress Install

Postposted on Thu Jul 18, 2013 8:30 am

thecoldanddarkone wrote:First time loading was slow, really slow. Second pc, it loaded instantly (this is after the first one loaded it really slow).


I get the same thing too, and when I open a different browser it still loads quickly. I also tried it on a separate test line we have here on a totally separate computer using the Google DNS servers, and it pulled up quickly too.

I think the reason is on the server. I think the PHP cache is expiring on the server, so whenever you go there the http server has to compile the PHP before it can server the webpage. Every request after that will used the compiled versions that are stored in the server cached.

The speed of the compilation is directly affected by the method used for compilation. mod_php is the fastest method for serving PHP, but it's also kind of insecure since it runs as the webserver user. Fast CGI is slower, but it is more secure since it runs as the owner of the files. Since this is a shared webhost, the webserver might be setup to use Fast CGI for security purposes.

These are just guesses, and you'll have to see how the server is setup.
Flatland_Spider
Gerbil Elite
 
Posts: 878
Joined: Mon Sep 13, 2004 8:33 pm
Location: The 918/539

Re: Need to troubleshoot slow Wordpress Install

Postposted on Thu Jul 18, 2013 8:31 am

It sounds like a reverse DNS lookup. Make sure that all your logging is by IP address and not by hostname.
notfred
Grand Gerbil Poohbah
 
Posts: 3775
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Need to troubleshoot slow Wordpress Install

Postposted on Thu Jul 18, 2013 4:08 pm

Nevermind, the recursive DNS server was having problems, so my tests were invalid.
Flatland_Spider
Gerbil Elite
 
Posts: 878
Joined: Mon Sep 13, 2004 8:33 pm
Location: The 918/539

Re: Need to troubleshoot slow Wordpress Install

Postposted on Sun Jul 21, 2013 12:53 am

notfred wrote:It sounds like a reverse DNS lookup. Make sure that all your logging is by IP address and not by hostname.

The timing certainly suggests that, but I don't have any logging plugins activated/installed. At least, not that I know of, unless one is already built into WP.

Flatland_Spider wrote:
thecoldanddarkone wrote:First time loading was slow, really slow. Second pc, it loaded instantly (this is after the first one loaded it really slow).


I get the same thing too, and when I open a different browser it still loads quickly. I also tried it on a separate test line we have here on a totally separate computer using the Google DNS servers, and it pulled up quickly too.

I think the reason is on the server. I think the PHP cache is expiring on the server, so whenever you go there the http server has to compile the PHP before it can server the webpage. Every request after that will used the compiled versions that are stored in the server cached.

The speed of the compilation is directly affected by the method used for compilation. mod_php is the fastest method for serving PHP, but it's also kind of insecure since it runs as the webserver user. Fast CGI is slower, but it is more secure since it runs as the owner of the files. Since this is a shared webhost, the webserver might be setup to use Fast CGI for security purposes.

These are just guesses, and you'll have to see how the server is setup.

The thing is, not even Drupal takes that long to compile. I am hitting the cache somewhere in the pipeline, but I think something else outside of the PHP might be holding it back, but I don't know how to find out what.
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
Crayon Shin Chan
Minister of Gerbil Affairs
 
Posts: 2253
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia

Re: Need to troubleshoot slow Wordpress Install

Postposted on Mon Jul 22, 2013 7:54 am

The caching DNS server that my internal DNS servers forward domain names unknown to them was having problems resolving domain names, so it was causing long load times while the domain name lookup timed out at the caching server. This caused me to think something was wrong with your server, but it was a problem on my end.

With that problem fixed, the load time is now inline with other sites. There is a slight pause before the page loads, but it's not on the order of what I was seeing.

Try changing your DNS server to something else, like Google or OpenDNS, and test the site with a clean browser cache to see if it makes a difference.
Flatland_Spider
Gerbil Elite
 
Posts: 878
Joined: Mon Sep 13, 2004 8:33 pm
Location: The 918/539

Re: Need to troubleshoot slow Wordpress Install

Postposted on Mon Jul 22, 2013 8:29 am

There are several online tools that can measure the speed of your webpage.

GTMetrix
http://gtmetrix.com/reports/ritchan.dasaku.net/D9VFZTZU

WebPageTest
http://www.webpagetest.org/result/130722_TK_JWM/

Pingdom Tools
http://tools.pingdom.com/fpt/#!/8Ieh1/r ... dasaku.net

WebsiteOptimizaiton.com
http://www.websiteoptimization.com/services/analyze/

WebWait
http://webwait.com/

Then there are the browser extensions like Google Speed Trace and YSlow.

If you have access to dig you can run the command "dig +trace ritchan.dasaku.net" to trace the DNS requests or "dig @8.8.8.8 + trace ritchan.dasaku.net" to trace the DNS requests using a specific DNS server.
Flatland_Spider
Gerbil Elite
 
Posts: 878
Joined: Mon Sep 13, 2004 8:33 pm
Location: The 918/539


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 0 guests

cron