-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Thread to monitor the kernel usage (CPU, Memory...) #912
Comments
It looks like the existing threads are heartbeat, iopub, and control. Jupyter Client has threads for iopub, shell, stdin, control, and heartbeat. I think it is worth trying to add a another thread, but maybe this is a good opportunity to add a performance regression check. SciPy uses airspeed velocity. |
Thx @blink1073 Great to know ipykernel is already kind with thread hosting. I guess an additional one
if we add a thread in ipykernel to monitor the resources, does that imply we ned also a thread in
+1
It would be good. I guess that is not a small task to get that performance benchmarking setup. |
I don't believe so, since client is launching ipykernel in a subprocess
I don't think it needs to be too comprehensive to start. |
Adding |
While implementing a jupyterlab extension to monitor the kernel usage (https://github.com/Quansight/jupyterlab-kernel-usage), a few PRs have been merged to use psutil to return Memory, CPU usage of the machine and the kernel processes.
This has worked great for most of the metrics, but we hit now an issue for the kernel CPU reported on Quansight/jupyterlab-kernel-usage#11. psutil returns the CPU based on the last call, so it looks like everytime we ask the CPU via the kernel websocket, it return zero as psutil considers it is the first time the request is made, see info on:
Please note that similar issue is reported on the jupyter-resource-usage extension (which monitors the server usage, not the kernel usage) jupyter-server/jupyter-resource-usage#107
A solution would be to maintain a separated thread that would be responsible to return that CPU in a correct way based on psutil.
What would be the impact to create such as separated thread? What are the already existing threads? Does it sound like a reasonable approach? Any other idea?
The text was updated successfully, but these errors were encountered: