• Michael

    (@michael8888)


    According to Code Profiler Wordfence requires about 10 times more CPU resources than an average plugin.

    The primary culprits are wordfence/vendor/wordfence/wf-waf/src/lib/utils.php and wordfence/vendor/wordfence/wf-waf/src/lib/rules.php

    Why is that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support wfmark

    (@wfmark)

    Hi @michael8888, Thank you for reaching out.

    Thanks for your message and sorry to see you’re having problems with CPU resources.

    Is this happening when running Scans?

    Wordfence runs well and unintrusively on the vast majority of ~5m sites it’s installed on despite having to consider many server and plugin/theme combinations. We constantly work on making the plugin faster, perform better, and use less resources but there are not set amounts of RAM, CPU or database queries that we know Wordfence will definitely require in each use-case or hosting environment. The cases of slow-down are small in relation to the quantity of customers using Wordfence, but does crop up from time to time with certain configurations or larger databases/number of installed plugins.

    For a screenshot of my recommended Performance setting options – Click Here.

    You could also set max_execution_time = 60 in php.ini, Wordfence’s scan only ever attempts to use half of this value by default.

    Your WP_MEMORY_LIMIT should be set to 128M or 256M in wp-config.php. WooCommerce, for example, recommend 64M minimum, so if you also have many hits on the site at once especially during a Wordfence scan, a lower limit here could be reached fairly easily. Your PHP memory_limit value could also be adjusted to 128M or 256M to accommodate this change.

    Aside from this, if there are any load-balancers or other APIs running on your server such as Litespeed or Cloudflare, you could check if these (or their configuration with Wordfence) are contributing in any way to the slow loading times. Cloudflare for example requires a bespoke Wordfence IP detection option selecting, and whitelisting of your own server’s IP in their settings for scans to run correctly.

    Thanks,

    Mark.

    Thread Starter Michael

    (@michael8888)

    Thanks for the reply. Before we proceed with this conversation, please measure Wordfence’s execution time with the Code Profiler plugin. Wordfence takes about 0.6 seconds to execute, which is equivalent to the execution time of all 50 of our other plugins combined.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wordfence requires a significant amount of CPU resources’ is closed to new replies.