-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100% CPU load on windows #626
Comments
@4n0nh4x0r thank you, yes this is something, we are doing an investigation. See also issue #616 ... hope to get a solution ready this weekend. |
Hopefully something can be done, othetrwise my monitoring system will take 100% of the cpu power for itself alone on windows servers lol |
Hello! I come to collaborate with this incident. I am developing a package of monitoring tools for servers and when testing version 5.9.7 it already had incidents with windows, I saw that I launch 5.9.14 and it persists. In my case, just checking any status flag (Timeup, CPU, OS) triggers the use of Powershell to 50% or more. PS> Whoever wants to know my monitoring utility is called Healty |
@4n0nh4x0r ... I made detailed research and it turns out that spinning up PowerShell Process is responsible for consuming resource and time. I now created a possibility to create a persistent PowerShell which then should reduce resources by 90% ... It would be great if you can test the latest code here on GitHub: What you have to do to enable the persistent power shell:
All commands In between will then use this already pinned up powerShell. The implementation ist still a little hacky ... but if your results are fine and this is what you would like to use, I will make a clean up! Any comments are welcome! |
Okay, that sounds fantastic actually I will test this once i m back at my dev pc |
@4n0nh4x0r closing the app should also work but it would be cleaner to call |
@sebhildebrandt
|
Awesome, it works for me As for the latest comment here on this thread, in my case this doesnt happen. |
@4n0nh4x0r have you tried my simple script above? |
For me it stays at stable low cpu usage, and the memory allocated to the powershell is at about 114MB in this case |
do you get a reply though in the console and node quits? |
I didnt get an output there, the script just continued doing work and never quits |
so its not just me then, so something isnt right with the also using your test script, the memory usage of powershell just keeps climbing for me?
|
@si458 Which version of nodejs are you using? |
Latest 14 LTS |
Would be interesting to see if this is maybe a node version issue rather than a library issue itself |
@si458 , @4n0nh4x0r thank you for your feedback! My feeling here is, that the issues you describes are not related to a specific node version. To sum up:
All this is unfortunately needed because we HAVE to move to powershell and spinning up a powershell shell is so costly. I wish all of this would be as easy as with linux or Mac ;-) |
@sebhildebrandt something to note |
USER: yes, you are right. The reason why it was replaced it due to international character problems. See also #610. The problem here is that windows keeps the original functionality and there is no way to get the stdout as UTF8 when executing WMIC: yes it is marked as deprecated (https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmic) and I got reports that in some versions it was not longer available (I guess with Windows 11 22483 and higher it will be then completely removed) ... Generally |
@4n0nh4x0r i have just tried upgrading my node to 16.13.0 and its the same issue |
@4n0nh4x0r after me watching |
in this way, with promise all I managed to obtain data from all sides without exploiting the use of cpu let search = new Object()
|
Fix the problem that systeminformation keeps launching new powershells on Windows platform, causing CPU usage to rise to 100%. More details: sebhildebrandt/systeminformation#626
Describe the bug
Its not really a bug, more just something i noticed
I m working on a monitoring tool using this library to get system data
Therefore i need to get the data constantly
On linux, this is no issue at all, but on windows, my cpu load goes up to 100%
To Reproduce
Current Output
The output is fine, it just puts a LOT of load on the cpu on my windows system
Expected behavior
Barely any noticable load on the cpu just like on my linux server
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: