Looks like sar is indeed capturing all processes+threads.

# sar -o /tmp/zfoo.sar.data 1 2  >& /dev/null

# sar -f /tmp/zfoo.sar.data -q
Linux 2.6.32-25-server (P-MXS-01)       11/15/2012      _x86_64_        (8 CPU)

02:38:42 AM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
02:38:43 AM         0       587      0.32      0.49      0.47
02:38:44 AM         0       589      0.32      0.49      0.47
Average:            0       588      0.32      0.49      0.47

# ls -d /proc/[0-9]*/task/* | wc -l
590

# ls -d /proc/[0-9]* | wc -l ; /usr/lib64/nagios/plugins/check_procs ;
ps faux | wc -l
416
PROCS OK: 415 processes
417

That seems to solve that mystery.  Now on to either getting sar to
record/display process (sans thread) counts or getting Nagios to
include thread counts.

Thanks, Rich and Charles.

Regards,
- Robert

On Wed, Nov 14, 2012 at 8:45 PM, Charles Sharp <[email protected]> wrote:
>
> Hi Robert,
>
> Instead of using /proc, you might want to count the pids under the
> /proc/<pid>/task
> directory.   There will be at least one (for the pid itself), plus pids for
> the the Linux
> tasks.
>
> I didn't have time to play with it much, but here's a first pass:
>
> cas@rock-ubuntu120464:~$ sudo find /proc -name task -exec ls {} \; |wc -w
> 315
> cas@rock-ubuntu120464:~$ ls -d /proc/[0-9]* | wc -l
> 141
>
> interesting,
> cas
>
>
> On Nov 14, 2012, at 6:15 PM, Robert Citek <[email protected]> wrote:
>
> On Wed, Nov 14, 2012 at 5:35 PM, Seibel, Rich <[email protected]> wrote:
>
> On Nov 14, 2012, at 2:39 PM, Robert Citek wrote:
>
> These three commands capture about the same information: the number of
> currently running processes:
>
> # ls -d /proc/[0-9]* | wc -l ; /usr/lib64/nagios/plugins/check_procs ;
> ps faux | wc -l
> 506
> PROCS OK: 505 processes
> 507
>
> Does sar collect that information?
>
>
> Maybe sar is counting LWPs, all the threads in all the processes.
>
>
> Possibly.  If so, any thoughts on how to reconcile the numbers?
> Although, I'm really only interested in processes and not threads.
>
> Regards,
> - Robert
> _______________________________________________
> Discuss mailing list
> [email protected]
> http://www.sluug.org/mailman/listinfo/discuss
>
>
>
> _______________________________________________
> Discuss mailing list
> [email protected]
> http://www.sluug.org/mailman/listinfo/discuss
>

-- 
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [email protected]
To unsubscribe: [email protected]
More options: http://groups.google.com/group/cwelug

Reply via email to