I seriously need to set up a tool that monitors CPU usage per account so that if a user uses more than an hour of CPU cycles, his account gets suspended automatically so that other users on the same server don't suffer. How could I do that? Thanks,
Process Accounting and Elbow Grease I'm not 100% sure how to do this, but I think you want to look to enable 'process accounting', and then scour that information via a cron task to find trouble makers. If you find one, do what you need to do to disable the user. Does this make sense? You could also look at periodically examining data from 'ps -ef' to find offending users. This would be a very interesting project to take on.
Problem is that for instance Apache is run as "nobody" Any idea how Dreamhost and these guys do to monitor how much CPU each account uses?
To limit CPU usage for Apache try using the RLimit* settings in the vhosts: Apache RLimitCPU Apache RLimitMEM Apache RLimitPROC
Thank you. Is there a way to limit globally for each account (FTP, MDA, etc...), for instance, each user can use up to an hour of CPU per day, whether it is Apache, PureFTPd, Popper, etc...?