Timeouts, 500 Errors, and 100% CPU usage
-
Hello, Ollie!
I was recently contacted by a friend who couldn’t access his admin dashboard. The pages would hang and either timeout or return a 500 error after a long wait. I narrowed down the issue to your plugin by disabling all plugins one by one via FTP. (by renaming their folders)On his website, I couldn’t get any other debug details because the admin dashboard was completely inaccessible, and WP_DEBUG didn’t return anything useful.
Yesterday, I noticed the same issue on a brand-new website, but this time, because the pages eventually loaded (after 60-90 seconds), I was able to get a few more details with Query Monitor. As far as I can tell, this happens when making queries on the users table, and only when the plugin is active. If I deactivate the plugin, everything works well again, with load times under 0.3s.
In this specific case, the problems started after installing Independent Analytics Pro and trying to access the Analytics menu. I also noticed that while the page hangs, the CPU spikes to 100%. (htop shows MySQL using 95-100% of the CPU)
Query Monitor shows this query under the Slow Queries tab, with a load time that ranges between 60 and 90 seconds:
SELECT DISTINCT wp_users.ID
FROM wp_users
INNER JOIN wp_usermeta
ON ( wp_users.ID = wp_usermeta.user_id )
INNER JOIN wp_usermeta AS mt1
ON ( wp_users.ID = mt1.user_id )
INNER JOIN wp_usermeta AS mt2
ON ( wp_users.ID = mt2.user_id )
INNER JOIN wp_usermeta AS mt3
ON ( wp_users.ID = mt3.user_id )
WHERE 1=1
AND ( wp_usermeta.meta_key = 'wp_iufsr:administrator'
OR mt1.meta_key = 'wp_iufsr:editor'
OR mt2.meta_key = 'wp_iufsr:author'
OR mt3.meta_key = 'wp_iufsr:contributor' )
ORDER BY user_login ASCTo debug this, you can use the free version of Independent Analytics. If you want to have the same query as the one above, you will have to go to the plugin Settings and exclude the following user roles from tracking: administrator, editor, author, contributor.
PS 1: This is a recent issue. It could be caused by the code changes you made in versions 1.3.0 or 1.3.1, or it might be a compatibility issue with WordPress 7.1.
PS 2: This issue might be related to the one created a week ago by @nothin7.
https://wordpress.org/support/topic/conflict-with-woocommerce-advanced-bulk-edit-wcabe
You must be logged in to reply to this topic.