How should I implement approximately correct per-user monitoring on a server? I want a way to split the cost of a server between the users based on their usage. On newer machines (RHEL6) I would use cgroups; on older kernels process accounting and ps averages. Are these the best ways?

closed as unclear what you're asking by Braiam, jimmij, jasonwryan, slm Oct 28 '14 at 1:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    I do not understand. If you already know the correct answer (cgroups, process accounting), what is your problem? – andcoz Oct 28 '11 at 13:09
  • 1
    What do you mean by "correct distribtion of costs for a user"? – rozcietrzewiacz Oct 28 '11 at 14:27

Measuring the consumption process is possible to measure the consumption of the User on the server. To measure the consumption of the process, I recommend using Atop software.


It might help you:


printf "%-10s%-10s\n" User MemUsage

while read u m
        [[ $old_user != $u ]] && {  printf "%-10s%-0.1f\n" $old_user $total_mem;
                                    total_mem=0; }
        total_mem="$(echo $m + $total_mem | bc)"

done < <(ps --no-headers -eo user,%mem| sort -k1)


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