CRITICAL ISSUE – WP Ajaxify Comments causes 504 errors on site
-
Hello,
We use WP Ajaxify Comments on a very large site, with literally multiple millions of user visits each month (20 million to 30 million).
This single site is on a dedicated enterprise tier cluster, with multiple web-heads, a dedicated database server, and a dedicated utility server. It literally costs several thousand dollars per month as you can imagine.
Our technical team, and the WordPress specific web host’s technical team, have been tracing the root causes of persistent 504 errors.
WP Ajaxify Comments has been identified as a cause of 504 errors.
Here is what the web host’s technical team reported to us this morning:
“I wanted to get you a bit more information around what we believe to be the root cause of the 504 errors. When looking at the logs, we identified a high frequency of index.php requests.
The problem with these requests that caught our attention was our inability to identify their origin. After cross referencing the logs and code we began to pinpoint the requests that were contributing to the server load.
The Ajaxify Comments plugin contains a function that uses admin ajax to reload the comments container. The function allows for comments to be loaded in real time without a refresh from the browser (and interruption of video playback). The problem in this function is how it retrieves the data on refresh. In wp-ajaxify-comments.js there is a function defined as WPAC.RefreshComments(); that makes a request to reload the page and store it in the browser.
It then parses through the reloaded page to identify the comments container and cuts out all other html. The problem with this is that it is causing a full render of the page uncached. This causes traffic to make full requests constantly at an interval resulting in exponentially growing requests. The variable autoUpdateIdleTime is set to 0 by default which seems to indicate that the update is constant. What I think is happening is the already high traffic is getting multiplied by a magnitude of however many times the page was triggered to refresh on the refresh interval. This may explain why in the logs we saw 500 responses for the same IP addresses.
I do not believe there will be an easy way to make this plugin work efficiently with a patch. The way the functionality is built does not give room for us to tweak it in any way. The admin ajax calls should be built in a way that retrieves the comment information separate from the entire pages data.”
If there is a way to work-around this issue, or if the WP Ajaxify Comments developers can resolve this issue, we may be able to use the WP Ajaxify Comments plugin again. Until then it’s been disabled.
Please let us know if this can be resolved, as our users enjoy the plugin’s convenience.
Thank you,
Chris
- The topic ‘CRITICAL ISSUE – WP Ajaxify Comments causes 504 errors on site’ is closed to new replies.