Wordfence scanning way too many files, using tons of I/O
-
Wordfence is scanning a huge number of files for sites hosted on one particular LAMP (Ubuntu 12.04) server. Typically, it’s scanning 48,000 files for sites that actually contain only 4000 to 8000 files. It looks like this behaviour started with the Wordfence 6.2 update.
Example from one very small site: [Sep 30 04:35:30] Scan Complete. Scanned 48283 files, 17 plugins, 5 themes, 5 pages, 0 comments and 16213 records in 1 hour 19 minutes 46 seconds. [Sep 30 04:35:31] Wordfence used 119.96MB of memory for scan. Server peak memory usage was: 209.09MB
All those numbers are correct except the number of files (17 plugins, 5 themes, 5 pages, 0 comments and 16213 records).
I checked all the Wordfence options, paying particular attention to ‘Scan files outside your WordPress installation’ (which was, and is, disabled). I enabled ‘Delete Wordfence tables and data on deactivation?’, deactivated, removed, installed and activated Wordfence on one of the sites, and nothing changed. I tried disabling all of the scan options, and while some of the checks were skipped, the scan still went through all those 48,000 files as usual.
Also, during scans on affected sites, the server’s hard drive light is on constantly, and disk I/O is extreme. I should point out that Wordfence scans have always hammered my server’s hard drive like this, but I’ve always assumed it was normal. Now I’m not so sure.
Since upgrading to Wordfence 6.2, scans are taking longer to complete, which makes sense if they’re scanning six times as many files. Previously they ran for about 20 minutes; now they’re running over an hour in some cases.
On other servers, the scans are indeed faster with Wordfence 6.2. And each group of 100 files scanned takes longer on the server in question than for sites on other servers.
Clearly there’s something about my server or the way it (Linux/Apache/Wordpress/Wordfence) is configured that’s causing the excessive disk I/O, and the mysterious extra files to be scanned. But what that is remains a mystery.
I’ve enabled debugging for one of the sites and will post any new info here.
- The topic ‘Wordfence scanning way too many files, using tons of I/O’ is closed to new replies.