||07-19-2005 09:24 PM
You can limit the cpu time a process or user can use and the process priorities but you cannot limit a user to only use, say 50% of the available cpu cycles.
An easy way to set user limits is through pam_limits.so. The drawback is, that these limits are enforced on a per session basis, not system wide. So if you limit the cpu time to n minutes for a particular user this limit will be enforced on the current login session. If the user logs in m times he has m*n minutes cpu time available. Of course, you can also limit the number of simultanous logins through pam_limits. See /etc/security/limits.conf and man limits.conf.
If you need something more sophisticated you might need to turn on process accounting and write a script to automatically take action once certain limits are reached.