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
4  
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
    
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

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.