Is it possible to constrain MsMpEng.exe (and any similar Windows tasks)?

Started by Tony Austin, January 11, 2016, 09:09:38 PM

Previous topic - Next topic

Tony Austin

Yes, yes, I understand that MsMpEng.exe is the task for Windows Defender, and Microsoft thinks that it knows best about controlling this task (and any other "critical" system tasks)!

But every now and then MsMpEng.exe starts using significan amount of CPU, typically around 20 percent (or a bit more) of my 8-core AMD processor. I would like to give this task an affinity to a single core, which would roughly halve its CPU usage.

However this task does not even appear in the "All processes" list of Process Lasso (why not?). Then when I fall back to using Task Manager's "Set affinity" it says: "The operation could not be completed.  Access is denied." ... Oh, woe is me.

Is there any solution to this? Or is it another example of Microsoft's deigning to be all-powerful with this task (an any similar ones, whatever they might be)?


edkiefer

Quote from: Tony Austin on January 11, 2016, 09:09:38 PM
Yes, yes, I understand that MsMpEng.exe is the task for Windows Defender, and Microsoft thinks that it knows best about controlling this task (and any other "critical" system tasks)!

But every now and then MsMpEng.exe starts using significan amount of CPU, typically around 20 percent (or a bit more) of my 8-core AMD processor. I would like to give this task an affinity to a single core, which would roughly halve its CPU usage.

However this task does not even appear in the "All processes" list of Process Lasso (why not?). Then when I fall back to using Task Manager's "Set affinity" it says: "The operation could not be completed.  Access is denied." ... Oh, woe is me.

Is there any solution to this? Or is it another example of Microsoft's deigning to be all-powerful with this task (an any similar ones, whatever they might be)?
Ok, first it is not a good idea to try an restraint AV type app as you generally want them to do there thing fast as there I/O bound a lot of time (checking files).

That said, one reason you could not find it, it maybe run by a service so it be listed as Scvhost.exe which many times runs many services per instance.
But you can also set priority in option "configure default CPU priority" and just add exe name and add to list.

Doing quick search though came up with these fixes for high CPU usage of it , they excluded it in MSE settings.

http://techat-jack.blogspot.com/2012/09/solved-high-cpu-usage-of-microsoft.html
http://answers.microsoft.com/en-us/protect/forum/mse-protect_scanning/msmpengexe-running-at-95-cpu-usage/4b079063-e93a-4e80-935b-c1d7ee02a672?auth=1
Bitsum QA Engineer

Jeremy Collake

It does not appear because these security products have tamper-detection and protection technologies that can sometimes go awry, so Process Lasso just leaves them alone - since it's primary mission is not to be a task manager.

However, you can make MsMpEng.exe show by unchecking 'Options / General / Ignore problematic processes'.

You never want to restrain security software because it is doing real-time scanning and a restraint of any kind may cause a blocking condition. However, some limited restraint can be done, sure.

BUT, it's much better to simply adjust Windows Defender settings.

In your case, it is surely doing it's scheduled scan. Change the schedule. And if you are doing real-time scanning, consider if you even need frequent scheduled scans? Also you can adjust other settings, for instance if it scans inside archives. If it finds a big archive, it can really get bogged down having to extract and scan every file inside.
Software Engineer. Bitsum LLC.

tberty

Quote from: Tony Austin on January 11, 2016, 09:09:38 PM
Yes, yes, I understand that MsMpEng.exe is the task for Windows Defender, and Microsoft thinks that it knows best about controlling this task (and any other "critical" system tasks)!

But every now and then MsMpEng.exe starts using significan amount of CPU, typically around 20 percent (or a bit more) of my 8-core AMD processor. I would like to give this task an affinity to a single core, which would roughly halve its CPU usage.

However this task does not even appear in the "All processes" list of Process Lasso (why not?). Then when I fall back to using Task Manager's "Set affinity" it says: "The operation could not be completed.  Access is denied." ... Oh, woe is me.

Is there any solution to this? Or is it another example of Microsoft's deigning to be all-powerful with this task (an any similar ones, whatever they might be)?

I've the same problem and after trying many solutions, it still occurs and eats my CPU resource.

Found this from Google.

https://usefulpcguide.com/18360/fix-msmpeng-exe-high-cpu-usage-problem/

It seems the only way to prevent MsMpEng.exe from eating CPU is to disable it, and use other antivirus programs.

edkiefer

You can try that in link and even use PL to lower affinity on it but how long does this high usage last?

On Win10 I see right after boot, maybe within a few min some high usage but it doesn't last long, It is not noticeable as to performance, I have to look for it.
Bitsum QA Engineer

Jeremy Collake

Sometimes these scanners get 'caught up' scanning large ZIP (or other) archives, in case you have any....
Software Engineer. Bitsum LLC.