Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

is it possible to obtain load average values (as displayed by uptime) individually per process or user.

I would like to be able to see what user is causing what load.

top is not really suitable because it only displays instantaneous values.

Any ideas?

share|improve this question
    
The assertion "top is not really suitable because it only displays instantaneous values." is false. It displays load at 1, 5 and 15 minutes ago... Moreover, you can use top with some switchs to parse it with shell tools like awk, sed, perl... –  sputnick Feb 20 '13 at 10:50
    
But the per-process CPU usage I think is only accumulated over a short interval like one second. It changes quite quickly.. –  Philipp F Feb 25 '13 at 9:12
add comment

1 Answer

up vote 1 down vote accepted

Having a "load average per user" doesn't make much sense, since a load average only makes sense in the context of a larger system. You can, however, get usage information, which might be what you want. sa from psacct can do this, for example:

Per application

# sa       
  223730   62617.91re      31.57cp         0avio      5583k
     284    1515.73re      10.45cp         0avio     46067k   perl
     314      17.53re       8.90cp         0avio     65746k   redis-server*
     152    1779.02re       6.46cp         0avio     56377k   vim
       8    2503.01re       1.69cp         0avio      6089k   snort*
   11209      99.64re       1.52cp         0avio      6100k   git
   20269      33.24re       0.48cp         0avio     30273k   postgres*
     140       0.48re       0.37cp         0avio      1831k   sort
       3    1193.10re       0.26cp         0avio    128389k   pipe_errorlog.c
       7    3146.93re       0.20cp         0avio    156983k   apache2*
      26       0.16re       0.15cp         0avio     32113k   ack
      19    2692.45re       0.12cp         0avio     14226k   sshd
      10       0.22re       0.11cp         0avio     14464k   apt-show-versio
      25       5.58re       0.08cp         0avio      7042k   apt-get
     118       0.40re       0.08cp         0avio      9674k   find
       4       1.51re       0.08cp         0avio      1212k   rkhunter
     377       0.33re       0.07cp         0avio     14768k   rm
     226    2696.40re       0.05cp         0avio     11524k   bash

Per user

# sa -m
root                               201825   17279.57re      13.26cp         0avio      2981k
110                                   255      14.86re       7.61cp         0avio     65544k
nobody                                222    4659.53re       7.24cp         0avio     38149k
snort                                   1    1440.00re       1.60cp         0avio     25792k
108                                   763     798.83re       1.24cp         0avio      6964k
105                                 12801      31.79re       0.47cp         0avio     33102k
114                                    94    2741.65re       0.09cp         0avio      9906k
109                                     7   16944.24re       0.02cp         0avio     25483k
Debian-exim                          3772       0.81re       0.00cp         0avio     25086k
man                                   182       0.02re       0.00cp         0avio      5203k
116                                    11     796.78re       0.00cp         0avio      9823k
107                                    10     795.09re       0.00cp         0avio      9823k
statd                                3690       0.68re       0.00cp         0avio     25532k
sshd                                   22       0.44re       0.00cp         0avio     12690k
www-data                                3       0.00re       0.00cp         0avio     11603k
111                                     2   17112.17re       0.00cp         0avio     19048k
mail                                    1       0.00re       0.00cp         0avio     11184k
share|improve this answer
    
Thank you. I think this would work for me if I had root access and could install psacct. Unfortunately I don't have that. If there is no other answer which works for me though, I guess this is the one that should be accepted. –  Philipp F Feb 25 '13 at 9:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.