I am using Ruby unicorn, and have configured it to have 15 worker processes.
How do I tell how many workers are actually processing work (are not idle, waiting for work) at any current time?
I am using Ruby unicorn, and have configured it to have 15 worker processes.
How do I tell how many workers are actually processing work (are not idle, waiting for work) at any current time?
Copyright © 2021 Jogjafile Inc.
If you just need the infomation on the command line, you could check how much CPU each is using:
ps aux --sort=-pcpu - Gets a list of all the processes running, sorted in CPU usage order reversed (Highest CPU first)
| - Pipes output of previous command to the next
grep '%CPU\|unicorn' - Returns only lines the contain %CPU (The first line) OR unicorn. \| is the OR symbol in the grep pattern.
You should get output like this, with CPU usage in the 3rd column, memory usage in the 4th:
High CPU usage means in use, tiny or no CPU means the worker is idle and not doing any work.