views:

78

answers:

4

I have a problem with a wordpress site and I really can't figure out what causes it.

All the pages in the site load perfectly fine, they are quite stuffed with content but the load time is ok and so is memory usage as they have no problem with a 32M memory limit set in wp-settings.php.

The problem comes with the home page. It takes several seconds to load (excluding other content, just the main request) and fails (where 'fails' stands for blank page shown) unless I raise the memory limit above 300M.

Possible suggestion 1: check index.php code

Done. I replaced it with a blank page only containing the word TEST, still same slow loading and blank page.

Possible suggestion 2: disable all plugins

Done. Disabled each and every plugin and still same exact behaviour.

My current workaround

The only thing that I could find to temporarily solve the issue, is redirecting (via wordpress' internal rewrite) any request for / to a custom page which is linked to index.php. This way I have the homepage working fine, quickly and under the 32M memory limit.

Now, this works but it's a horribly dirty hack, so how can I find out what wordpress is doing when I ask for the home page before loading the template given that it has nothing to do with plugins?

A: 

Not easy to tell, but there is a way to find out: use the xdebug profiler, and then use kcachegrind or its windows port to view its results. It will show you lots of data, including a visual chart, which will hopefully be very helpful in identifying where is PHP spending most of its time...

Palantir
I'll see if I can install it (I'm not sure, server is not mine)
kemp
Never install that on a production server. Download your site and install everything on your local computer. It is great for development but it can be a security hole.
Palantir
+2  A: 

If you've tried replacing index.php with just plain text then i would definitely check your .htaccess file for errors, extra characters, or some type of invalid configuration. Disable it and see if that helps for starters.

mootools
+1  A: 

To see if anything comes out try adding WP_DEBUG=true to wp-config.php Might show you if something else is erroring earlier But otherwise yes kachegrind or xdebug definately

Also if on unix and you have access try strace command on the apache process

Shaun Hare
A: 

Is the server itself doing any pre/post processing on the homepage?

Turning on PHP errors may shed some light on the process as will looking at the httpd error log.

Out of curiosity, are you positive your site hasn't been hijacked?

MPD
No other processince that I'm awary of, just normal wordpress page life cycle. Error reporting only shows several notices for undefined indexes. I'm positive the server is clean.
kemp