Skip to content
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

known issue: manage_numcalc_script.py freeze and high CPU usage #50

Open
SDX-LV opened this issue Aug 27, 2022 · 1 comment
Open

known issue: manage_numcalc_script.py freeze and high CPU usage #50

SDX-LV opened this issue Aug 27, 2022 · 1 comment
Labels
wontfix This will not be worked on

Comments

@SDX-LV
Copy link
Contributor

SDX-LV commented Aug 27, 2022

On one of the 2 tested Win10 computers manage_numcalc_script.py is dead-slow - unusable.

I traced the issue to the _numcalc_instances() function in manage_numcalc.py.
Specifically on that Windows computer the for p in psutil.process_iter(['name', 'memory_info']): takes about 2,5 minutes to execute and fully loads one CPU core. As this command is called after each NumCalc Instance, it looks like the script is dead.

The issue could be caused by antivirus or some corporate software, but the

workaround in manage_numcalc.py is to change line:
running_instances = _numcalc_instances()
to
running_instances = 7.777 # workaround _numcalc_instances()

This will skip the extremely slow _numcalc_instances() function and fix the performance. What is lost is the possibility to limit CPU core limit (max_instances), but the max_cpu_load is still available (even if it is not very effective).

If more people are affected, please report it here and then the issue may get a permanent fix.

@SDX-LV SDX-LV added the wontfix This will not be worked on label Aug 27, 2022
@f-brinkmann
Copy link
Contributor

That sounds nasty. Please report if you experience this on other machines as well. If this is the case, I would suggest to kill the process if it takes to long and raise a warning to inform the user. It seems as if subprocess can do this out of the box: https://medium.com/@chaoren/how-to-timeout-in-python-726002bf2291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants