Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
Crayon Shin Chan
Minister of Gerbil Affairs
Topic Author
Posts: 2313
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Need to troubleshoot slow Wordpress Install

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:
<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: FX-8350, 12GB DDR3, M5A99X EVO, MSI GTX 1070 Sea Hawk, Crucial MX500 500GB
Supply ship: [email protected], 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Thinkpad X230
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Need to troubleshoot slow Wordpress Install

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?
Nostalgia isn't what it used to be.
 
thecoldanddarkone
Minister of Gerbil Affairs
Posts: 2449
Joined: Wed Mar 26, 2003 4:35 pm

Re: Need to troubleshoot slow Wordpress Install

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 4930k, 32 GB Ballistix DDRL3@2133 , 1.2 TB Intel 750 AIC, 500 GB mx200, Sapphire R9 Fury, asus x79 ws, HP ZR24w, edifier s730
HP Pro x2 612- i5-4302Y, 8 gigs of memory, 256 ssd
 
Flatland_Spider
Graphmaster Gerbil
Posts: 1324
Joined: Mon Sep 13, 2004 8:33 pm

Re: Need to troubleshoot slow Wordpress Install

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.
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Need to troubleshoot slow Wordpress Install

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.
 
Flatland_Spider
Graphmaster Gerbil
Posts: 1324
Joined: Mon Sep 13, 2004 8:33 pm

Re: Need to troubleshoot slow Wordpress Install

Thu Jul 18, 2013 4:08 pm

Nevermind, the recursive DNS server was having problems, so my tests were invalid.
 
Crayon Shin Chan
Minister of Gerbil Affairs
Topic Author
Posts: 2313
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

Re: Need to troubleshoot slow Wordpress Install

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: FX-8350, 12GB DDR3, M5A99X EVO, MSI GTX 1070 Sea Hawk, Crucial MX500 500GB
Supply ship: [email protected], 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Thinkpad X230
 
Flatland_Spider
Graphmaster Gerbil
Posts: 1324
Joined: Mon Sep 13, 2004 8:33 pm

Re: Need to troubleshoot slow Wordpress Install

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
Graphmaster Gerbil
Posts: 1324
Joined: Mon Sep 13, 2004 8:33 pm

Re: Need to troubleshoot slow Wordpress Install

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.

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On