Here is some back story, my webhosting shut all my sites down because admin-ajax.php was creating DB connections and sleep for long periods of time. The highest sleep time I saw was 45s. What I determined is that in one of the WP updates, from WP 3.5 to WP 3.7.1, admin-ajax.php started being called from multiple admin pages (/wp-admin/widgets.php, /wp-admin/index.php, /wp-admin/themes.php, and a few more) ever 2.5-3 min, even if nothing on the pages was touched. While this issue doesn’t cause any problems if you only have one admin page open and close it after each use. But when you have multiple pages open and leave them open all day or over night WP will continue to make the POST to admin-ajax.php. After multiple hours (10+ when it is easiest to see) all of these continual POSTs will starts to negatively impact MYSQL. Database connection from admin-ajax.php will just sleep for multiple seconds even thought nothing is going on.
For reference In WP 3.5 admin-ajax.php was only called automatically on the post.php page (I believe for autosave purposes). Also on 3.7.1 I switched to the default twenty thirteen theme and deactivated all the plugins and the auto POST things is still occurring.
What is the point of admin-ajax.php being called on pages where no information was change and no ajax was initiated? Is there a way to turn this off? Is this a feature of WP and expected functionality?
- The topic ‘Admin-ajax.php being Called from Admin Pages Causing DB Connection Issues’ is closed to new replies.