jupyter-resource-usage
jupyter-resource-usage copied to clipboard
Switching user in jupyter makes /api/metrics slowly
When I add some users in jupyter, constantly switching users makes the response of /api/metrics slowly.
Suppose there are two users root and jov, I try the following command,
# default user is jov, now switch to root
sudo su
# switch to jov
su jov
# switch to root
sudo su
# switch to jov
su jov
...
before switching users, the response time of /api/metrics is 300ms After switching uses, the response time of /api/metrics is 1600ms.
This is too weird
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Supplementary note
If i try 'exit' command in the terminal, the response time of /api/merics return to normal level
The response time is mainly influenced by the time the following get-function takes:
https://github.com/jupyter-server/jupyter-resource-usage/blob/master/jupyter_resource_usage/api.py#L20
I would assume the time the psutil-calls answer are different depending on how many processes/users are active on the system. This seems not to be an issue of jupyter-resource-usage.