The MID server is used by many Servicenow applications and integrations. Some of the applications are Discovery, Service Mapping, Orchestration, Event Management, as well as a multitude of integrations. At times, the MID server JVM may use up more CPU than expected in the host server. This KB highlights some of the reasons CPU could go high on a MID server and how to find out what thread in the JVM is using up the resources. Knowing what thread is using up the resources is important to finding out a root cause as well as what team would be best suited to further investigate the issue.
Note: The MID server at times will use up 100% of the CPU while the MID server is actually busy. This would usually only be considered a problem if happening for long periods of time and affecting server performance, or if using up resources when not doing any actual work.
When the MID server is being used it will create files on the user's temporary folder and on the mid server folder itself. A MID server that is heavily utilized may create and remove many such files. Antivirus software may attempt to review such files and use up CPU resources while doing so.
As a workaround:
Note: If necessary, the temp folder can be updated via parameter java.io.tmpdir. See KB0747569 on to change the temporary directory.
When windows discovery is run it will create Powershell processes. When running lots of windows discovery these can add up and lead to high CPU usage.
As a workaround:
Note: As outlined on our mid server system requirements documentation "you can set threads.max as high as 200, however, this setting may need to be changed depending on the OS. For example, Windows-based MID Servers running Discovery uses Powershell which is resource intensive. In this case, you may exhaust the CPU power of the host machine with just 50 threads count." However, depending on the CPU this could happen at even lower thread counts and thus the max thread count may need to stay under 50, or even lower than the default of 25.
For windows MID servers: