Scanning the entire site's content is, by its very nature, a CPU, memory, database and disk intensive operation. We have to go through every single file of your site, find our which ones are PHP files, read their contents, run a number of complicated pattern matches on each one of them, calculate differences with the contents stored in the database and record the results. That is a lot of work.
We can try to make the scan run with a smaller
overall impact on the system by applying a duty cycle. Think of it as something like 1 second of scanning, 4 seconds of sitting on its hands doing nothing at all. This will make the scan just over 5 times slower (there's some overhead jumping from idle to scanning, that's why it's not
exactly 5x slower). However, the peak CPU usage (burst) will still be close to 100% since you cannot possibly apply a duty cycle to the pattern matching itself: the bulk of its CPU usage occurs inside a built-in PHP function which effects the pattern matching and which, from the perspective of our code, is akin to a black box.
Here is what you can do to make it a bit better.
Go to PHP File Change Scanner page and click on the blue Configure button. Under Fine Tuning set:
- Minimum execution time: 5 seconds
- Maximum execution time: 2 seconds (yes, the maximum is less than the minimum, you read this correctly)
- Runtime bias: 50%
This will have the scanner work for 1-2 seconds and sit back doing nothing for 3-4 seconds, implementing the roughly 20% duty cycle I discussed above.
If you don't mind making your life harder there's one more thing to do. Go to PHP File Change Scanner and click on the Options button in the toolbar. Set "Calculate diffs when scanning" to No. You will no longer see a difference of the current (on disk) version of each modified file to its previous version. You will just be told that the file was modified.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!