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.

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?

share|improve this question

closed as unclear what you're asking by Braiam, jimmij, jasonwryan, slm Oct 28 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

2 Answers 2

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.

share|improve this answer

It might help you:

#!/bin/bash
total_mem=0

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

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

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

#EOF
share|improve this answer

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