emailuser172's Avatar
emailuser172 3
2 Asked
0 Answered
0 Best
0
No one has voted on this question yet :(
3 years, 4 months ago

In FreeBSD, how can I find out how many processes are running?

I want to plot the number of processes vs time. Periodically I will query the number of processes and use that value for the next data point.I am using FreeBSD 7.0 GENERIC. The only way I know how to do this is to use the 'ps' command and pipe its output to 'wc -l' but I think there must be a more efficient way. That sort of info might be available in some kind of special system variable, but I hardly know anything about FreeBSD internals.
Tip for best answer: M$0.00
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

What is Your Answer?

0
0
0

3 Answers

0
alfy's Avatar
alfy | 3 years, 4 months ago
4
Sorry not an expert of FreeBSD internals, there not that many around!
I think you might have to make do with ps, just take care of removing from the count your own grep and ps

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
briealeida's Avatar
briealeida | 1 year, 6 months ago
3
Part of the output of top helps with counting the number of processes spawned vs time. The 'last pid' value will show you the PID of the last process. If top updates for you every five seconds and you watch this value, you can determine (albeit roughly) if processes are being created very quickly or not.

http://www.freebsd.org/doc/handbook/basics-processes.html

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
sysaaron's Avatar
sysaaron | 2 years ago
3
ps wax | wc -l

man ps
man wc

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel

Learn something new with our FREE educational apps!

Private lessons in the comfort of your own home. Get back in shape or finally pick up a guitar with our great experts guiding you the whole way!
Learn Guitar
Learn Hip Hop
Learn Pilates