sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

add the the table of processes data about the number of processes #7914

Open williamstein opened 1 month ago

williamstein commented 1 month ago

CoCalc projects have a pid limit that is 750. If you launch a large number of Jupyter notebooks (say), then you can easily hit this. Note that the way this limit evidently works is that it's not a limit on the number of processes output by "ps", but on the number of threads, as output by this:

$ ps -eL --no-headers | wc -l
728

This is in a project that was just hitting the limit, and then (from outside) I killed a few python processes.

We should (1) regularly monitor this number just like memory, cpu, etc., and (2) if it gets near the hardcoded limit of 750 (on kucalc at least), suggest actions, and possibly even automatically kill the least active notebooks.

williamstein commented 1 month ago

To see the exact threads using pids:

ps ax -L| more

E.g.,

$ ps ax -L|grep python |wc -l
710