• Resolved SiGa

    (@siga)


    For a while now, I got troubles with scans not completing (running forever until I stop them manually). I already read some threads about that and tried to modify settings in the way that was recommended (How much memory should Wordfence request when scanning ==> set to 80 / Maximum execution time for each scan stage ==> 15, just for example), which didn´t help.
    Last successful scan shows: “Wordfence used 38.87MB of memory for scan. Server peak memory usage was: 56.42MB”

    Something is causing my site to slow down until it does hardly responds every now and then and I´m trying to find out if it´s related to those infinite scans or something else. Would appreciate any further hints what I can do to troubleshoot this.

    https://wordpress.org/plugins/wordfence/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    How much memory do you have allocated to your site? We recommend 128MB.

    http://docs.wordfence.com/en/Wordfence_system_requirements#Memory

    Your scan could also be hanging on a large file and then not completing. Are you able to see where the scan hangs?

    -Brian

    Thread Starter SiGa

    (@siga)

    Hi, Brian!

    Memory shouldn´t be a problem, here´s the utility test:

    –Starting test–
    Current maximum memory configured in php.ini: 512M
    Current memory usage: 15.50M
    Setting max memory to 90M.
    Starting memory benchmark. Seeing an error after this line is not unusual. Read the error carefully
    to determine how much memory your host allows. We have requested 90 megabytes.
    Completing test after benchmarking up to 80.25 megabytes.
    –Test complete.–

    Seems that hosting sets a limit for one process? According to this, I set maximum memory for Wordfence to 80 MB. Should I contact them?

    No, I wasn´t able to find out where exactly the scan hangs. I excluded the largest files (like backups from BackupBuddy) from the scan. The last scan I manually stopped looks like this in the log:

    [Jan 18 20:26:48:1453141608.405347:1:info] Scan kill request received.
    [Jan 18 18:14:58:1453133698.830699:1:info] Scheduled Wordfence scan starting at Monday 18th of January 2016 06:14:58 PM
    [Jan 18 10:58:44:1453107524.432482:2:info] Analyzed 2400 files containing 28.41 MB of data so far
    [Jan 18 10:58:24:1453107504.695726:2:info] Analyzed 2300 files containing 27.23 MB of data so far
    [Jan 18 10:58:20:1453107500.468361:2:info] Analyzed 2200 files containing 24.84 MB of data so far
    [Jan 18 10:58:17:1453107497.310665:2:info] Analyzed 2100 files containing 22.19 MB of data so far
    [Jan 18 10:58:16:1453107496.304422:2:info] Analyzed 2000 files containing 21.6 MB of data so far
    [Jan 18 10:58:12:1453107492.509647:2:info] Analyzed 1900 files containing 19.32 MB of data so far
    [Jan 18 10:58:09:1453107489.028491:2:info] Analyzed 1800 files containing 15.91 MB of data so far
    [Jan 18 10:58:06:1453107486.859515:2:info] Analyzed 1700 files containing 15.39 MB of data so far
    [Jan 18 10:58:04:1453107484.405745:2:info] Analyzed 1600 files containing 14.94 MB of data so far
    [Jan 18 10:58:03:1453107483.681371:2:info] Analyzed 1500 files containing 14.64 MB of data so far
    [Jan 18 10:58:03:1453107483.260388:2:info] Analyzed 1400 files containing 14.42 MB of data so far
    [Jan 18 10:58:02:1453107482.551684:2:info] Analyzed 1300 files containing 13.84 MB of data so far
    [Jan 18 10:58:01:1453107481.449837:2:info] Analyzed 1200 files containing 13.31 MB of data so far
    [Jan 18 10:58:00:1453107480.910748:2:info] Analyzed 1100 files containing 13.2 MB of data so far
    [Jan 18 10:58:00:1453107480.465904:2:info] Analyzed 1000 files containing 13.02 MB of data so far
    [Jan 18 10:57:57:1453107477.629251:2:info] Analyzed 900 files containing 12.19 MB of data so far
    [Jan 18 10:57:57:1453107477.029515:2:info] Analyzed 800 files containing 11.68 MB of data so far
    [Jan 18 10:57:56:1453107476.152451:2:info] Analyzed 700 files containing 10.85 MB of data so far
    [Jan 18 10:57:55:1453107475.298874:2:info] Analyzed 600 files containing 10.14 MB of data so far
    [Jan 18 10:57:54:1453107474.038288:2:info] Analyzed 500 files containing 7.95 MB of data so far
    [Jan 18 10:57:52:1453107472.227786:2:info] Analyzed 400 files containing 5.53 MB of data so far
    [Jan 18 10:57:50:1453107470.677164:2:info] Analyzed 300 files containing 4.5 MB of data so far
    [Jan 18 10:57:49:1453107469.050697:2:info] Analyzed 200 files containing 2.45 MB of data so far
    [Jan 18 10:57:47:1453107467.329450:2:info] Analyzed 100 files containing 1.21 MB of data so far
    [Jan 18 10:57:42:1453107462.963728:2:info] Found 3 themes
    [Jan 18 10:57:42:1453107462.952510:2:info] Getting theme list from WordPress
    [Jan 18 10:57:42:1453107462.950199:2:info] Found 23 plugins
    [Jan 18 10:57:41:1453107461.435692:2:info] Getting plugin list from WordPress
    [Jan 18 10:57:40:1453107460.661240:1:info] Contacting Wordfence to initiate scan
    [Jan 18 10:57:26:1453107446.268069:1:info] Scheduled Wordfence scan starting at Monday 18th of January 2016 10:57:26 AM

    Right afterwards I started another scan manually. That went just fine and says:

    Scan Complete. Scanned 5971 files, 23 plugins, 3 themes, 40 pages, 95 comments and 27753 records in 172 seconds.

    As you see, the site isn´t really large.

    If it was a certain file, wouldn´t it hang every time?

    More facts: It´s the free version and I do have days when two scans are started, only 8 hours apart.
    I also found this in the log (only once during last week):

    [Jan 14 15:45:05:1452779105.700537:1:error] Scan Engine Error: Wordfence could not start a scan because the cron key does not match the saved key. Saved: ….. Sent: ….. Current unexploded: ….. (Removed the keys from that message – tell me if you´d need to see them)

    Plugin Author WFMattR

    (@wfmattr)

    @siga: You can set the memory for Wordfence back up to 256M or higher for your site — the memory test only checks up to 80.25 on all sites currently. (The max memory in the test will be increased in a future version.)

    The two scans starting in the same day may be caused by page caching on your site. The scans use wp-cron, which can only start jobs when a visit comes in to a page that is not cached. If a job is overdue, it will start later than it should, even if it is the next day. If you can temporarily disabling caching, to see if the problem stops — it’s not a permanent solution, but can help narrow down the cause.

    For troubleshooting, can you also turn on the option “Disable config caching” and set the “Maximum execution time for each scan stage” back down to 15 seconds if it is different? (Both are near the bottom of the Wordfence options page.)

    If you’re not using page caching, check if your host has Varnish or any other type of cache outside of WordPress — these can also cause unusual problems sometimes.

    -Matt R

    Thread Starter SiGa

    (@siga)

    Thanks for getting back to me, Matt, and also for your suggestions, much appreciated! I will try that, have an eye on it for a while and report if I can see some changes. Have a nice weekend! 🙂

    Edit: Wanted to add that I use BWP Minify, just for the records. Will turn it off for now.

    Plugin Author WFMattR

    (@wfmattr)

    Great, let us know how it goes! I’m not familiar with BWP Minify, but if it’s only minifying scripts and styles, it might not be an issue. (If you can live without it temporarily though, it is one more factor that can be ruled out.)

    -Matt R

    Thread Starter SiGa

    (@siga)

    I do not use any caching plugin (or CDN) so far and also my hosting doesn´t do caching outside of WordPress. I do leverage browser caching and use AddOutputFilterByType DEFLATE in my htaccess though – would that have any influence? Don´t think so, but trying to rule out things…

    Thread Starter SiGa

    (@siga)

    Just a heads up: So far no scan got hung up during this last week. 🙂 Will dare to re-activate BWP Minify to see if has influence.

    Plugin Author WFMattR

    (@wfmattr)

    I don’t think the “deflate” setting should have an effect. It sounds like you’ve got it running though, so let us know if there are any other issues. Thanks!

    -Matt R

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Scans not completing’ is closed to new replies.