Slow Scans & High CPU Load on Server due to InnoDB Engine
-
This is not a question – it’s a tip for others who might be experiencing super slow scans and & very high CPU usage. I have had WordFence in place on a bunch of sites for many years with no issues. Scans usually take less than a minute to complete – unless the site is huge, in which case it can take a few minutes. In mid-2020 I migrated to a new server with identical settings BUT on every new site on the server with WordFence installed, scans were taking on average 24 – 36 minutes to complete AND I was seeing huge CPU spikes every time a scan was run. I’ve been trying to figure this out for a LONG time and FINALLY figured out the culprit: InnoDB
Today I happened to check Wordfence > Tools > Diagnostics > Database Tables …and when comparing this to other sites, ALL of the new sites are showing the MySQL engine to be InnoDB for the Wordfence tables. On the old sites, the MySQL engine is MyISAM.
So I manually edited /etc/my.cnf (I have root access…if you don’t, conctact your hosting provider) and added:
default-storage-engine=MYISAM….then restarted MySQL.
I exported the settings, then uninstalled Wordfence (being sure to check “Delete Wordfence tables and data on deactivation”, then reinstalled Wordfence & imported my settings. I checked to confirm the Wordfence tables are now MyISAM. I ran a scan; the same scan that took over 24 minutes previously now takes 14 seconds.
Hopefully this helps someone else experiencing this problem…
pk
- The topic ‘Slow Scans & High CPU Load on Server due to InnoDB Engine’ is closed to new replies.