joe-at-startupmedia / pmon3

Golang Production Process Manager
10 stars 0 forks source link

topn command doesn't work when more than 20 processes are registered #32

Closed joe-at-startupmedia closed 2 months ago

joe-at-startupmedia commented 2 months ago

That's because the linux top command only allows 20 pids. A work around could be to randomize the pid list on every iteration.

joe-at-startupmedia commented 2 months ago

The commit above randomizes the pid list. Not the best solution but it works. Ideally it should spawn n top processes (where n = managed processes / 20) and merge the results. This however would remove the ability to proxy column sorting to the linux top command and would instead have to be handled natively in the code. Will revisit later if necessary.