Server Crashing Because of Excessive POST admin-ajax.php

Whenever our site hits 1,000+ concurrent users, the site goes down due to, what I can best determine is POST admin-ajax.php calls. I’ve been trying to debug the issue, and running tests on GTmetrix. Here is the reading:

And here is the reading after turning off the Patreon plugin.

You can see it cuts the wait time for admin-ajax.php by half, and it also cuts the fully load time of the page overall by over a second.

Do I have something configured wrong?

Are you using “WP Tab Widget” plugin?

My suspicion is that a plugin you are using for your theme or some other purpose is doing ajax posts. Tabs, or theme’s inbuilt tabs or something.

This would cause numerous requests from each user when there are many users.

This may cause the Patreon details updating function to contact Patreon to pull the user’s info. That can lead to a wait time in between requests due to I/O of contacting an outside network.

For now comment out the below line

add_action( ‘wp_head’, array( $this, ‘updatePatreonUser’ ) );

in patreon_wordpress.php. This will reduce the load to a noticeable extent. Upcoming 1.2.0 version will address this issue.

For every valid logged in user that is a known patron a call to Patreon would be done to check their patronage status. This is currently unavoidable. In a later version we are going to change it to work with webhooks so this will not be a concern.

No I am not using the “WP Tab Widget” plugin.

I commented out the line of code suggested. I’ll know if it helped Saturday, when we receive a spike in users over 26,000 hits in an hour last Saturday. It didn’t seem to effect the wait time in between requests according to GTMetrix. I have debugged, turning off the theme and all other pluggins, and nothing seems to have as drastic an effect on it as to when I turn off the Patreon plugin.

Here is a list of active themes and plugins.

Video by MyThemeShopVersion: 2.1.9

Google Analytics for WordPress by MonsterInsights Version 7.2.0
Heartbeat Control Version 1.2.5
MaxButtons Version 7.4.1
OTF Regenerate Thumbnails Version 0.3
Patreon Wordpress Version 1.1.2
Printful Integration for WooCommerce Version 2.0.4
Really Simple SSL Version 3.0.5
Seriously Simple Podcasting Version 1.19.11
Ultimate Category Excluder Version 1.1
UpdraftPlus - Backup/Restore Version 1.14.13
WC Password Strength Settings Version 2.0.2
WooCommerce Version 3.4.5
WooCommerce Services Version 1.16.1
WooCommerce Stripe Gateway Version 4.1.10
WordPress Persistent Login (Premium) Version 1.2.3
WP Config File Editor Version 1.6.7
WP Crontrol Version 1.6.2
WP Mail SMTP Version 1.3.3
WP Rocket Version 3.1.4
WP Video Robot Version 1.9.20

Can you give a try to the new 1.2.0 beta? Disable Patron Pro while testing it though - its not yet compatible.