Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a really strange problem. I have to fix a strange bug in a wordpress installation that is related to the server load.

When the site receive more than 5 parallel request some pages starts to throw 404 errors. The pages throwing the errors are never the same and seems to be totally random.

I can recreate the problem on my local machine using curl in the terminal :

$ curl -I http://site.local.com/path/to/page & curl -I http://site.local.com/path/to/page/ & curl -I http://site.local.com/path/to/page/ & curl -I http://site.local.com/path/to/page/ & curl -I

HTTP/1.1 200 OK
Date: Fri, 13 Jun 2014 14:31:09 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y
X-Powered-By: PHP/5.5.11
X-Pingback: http://site.local.com/xmlrpc.php
Content-Type: text/html; charset=UTF-8

HTTP/1.1 404 Not Found
Date: Fri, 13 Jun 2014 14:31:09 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y
X-Powered-By: PHP/5.5.11
X-Pingback: http://site.local.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Content-Type: text/html; charset=UTF-8

HTTP/1.1 200 OK
Date: Fri, 13 Jun 2014 14:31:09 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y
X-Powered-By: PHP/5.5.11
X-Pingback: http://site.local.com/xmlrpc.php
Content-Type: text/html; charset=UTF-8

HTTP/1.1 200 OK
Date: Fri, 13 Jun 2014 14:31:09 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.5.11 mod_ssl/2.2.26 OpenSSL/0.9.8y
X-Powered-By: PHP/5.5.11
X-Pingback: http://site.local.com/xmlrpc.php
Content-Type: text/html; charset=UTF-8

The second curl call return a 404 errors.

I have disabled all the plugins and this behavior is still happening.

Anyone have any ideas?

share|improve this question
    
Does it also happen when using a standard theme such as twentyfourteen? –  vancoder Jun 13 at 18:42
    
Does not happen with the standard theme. The theme the project is using is the "Stand" theme. Do you know any files I should be profiling to point point the issue? –  Hubert Perron Jun 16 at 14:55
    
I'm not familiar with the theme, so I cannot be specific. My guess would be there's some poorly designed database interaction built into the theme, that is causing the crashing. Try contacting the developer. –  vancoder Jun 16 at 17:17

1 Answer 1

up vote 0 down vote accepted

Finally found the problem.

This theme flush the rewrite rules on every request. I have removed the multiple calls to flush_rewrite_rules() and the problem is now gone.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.