Hey folks,
I turned on process accounting and had a peek at the man page for dump-acct but I am still left wondering how best to make use of this info.
We want to be able to produce some monthly stats on which labs are using how much of our clusters. I know our clustering software has the ability to do this but unfortuantely not everyone uses the cluster commands as much as I keep reminding them.
Would be nice to be able to show that user X used Y% of the CPU in a given month.
I've been googling but not turning up much more than how to install psacct and run the base commands.
thanks, -Alan
From: Alan McKay alan.mckay@gmail.com
I turned on process accounting and had a peek at the man page for dump-acct but I am still left wondering how best to make use of this info. We want to be able to produce some monthly stats on which labs are using how much of our clusters. I know our clustering software has the ability to do this but unfortuantely not everyone uses the cluster commands as much as I keep reminding them. Would be nice to be able to show that user X used Y% of the CPU in a given month.
From a quick look, it does not seem to have a user entry in the stats... A quick and dirty way would be to put a "script-in-the-middle" that would have a name specific to a given user, and then parse the stats by filtering on that script name... compute_$USER1, or compute_$UID... The user runs its dedicated script, and then the script runs the real command... You could add aliases in bashrc that points the generic commands to the specific ones...
JD
On Tue, Mar 20, 2012 at 7:11 AM, John Doe jdmls@yahoo.com wrote:
From a quick look, it does not seem to have a user entry in the stats...
UID and GID are there
Anyone else have anything on this?
From: Alan McKay alan.mckay@gmail.com
On Tue, Mar 20, 2012 at 7:11 AM, John Doe jdmls@yahoo.com wrote:
From a quick look, it does not seem to have a user entry in the
stats... UID and GID are there Anyone else have anything on this?
Indeed, I looked too fast and missed the IDs... So, why not just something like this: dump-acct /var/account/pacct | awk -F| ' { total_cpu += $4; cpu[$5] += $4; total_ram += $7; ram[$5] += $7 } END { for (x in cpu) { print x" "int((cpu[x]*100)/total_cpu)"% "int((ram[x]*100)/total_ram)"%"; } } ' Or just 'sa -m'?
JD
On Mon, Mar 26, 2012 at 8:57 AM, John Doe jdmls@yahoo.com wrote:
Indeed, I looked too fast and missed the IDs... So, why not just something like this: dump-acct /var/account/pacct | awk -F| ' { total_cpu += $4; cpu[$5] += $4; total_ram += $7; ram[$5] += $7 } END { for (x in cpu) { print x" "int((cpu[x]*100)/total_cpu)"% "int((ram[x]*100)/total_ram)"%"; } } ' Or just 'sa -m'?
Thanks, yeah I can definitely do that - just wanted to see if there was something already out there which had a few bells and whistles.
But that raw data above should be good enough for my use