CPU percentage limits
Project description
The goal of the project is to add the CPU percentage usage accounting to the existing racct/rctl infrastructure. I want to make it possible for the system administrator to limit either a particular process, a particular user or a particular jail to for example 30% CPU.
Deliverables
- CPU limits for process
- CPU limits for user
- CPU limits for jail
Milestones
May 21 - June 10: add racct/rctl cpu usage accounting, applicable only to a thread, support only for one scheduler.
June 11 - June 24: add racct/rctl cpu usage accounting, applicable also to a user, support only for one scheduler.
June 25 - July 1: add support for the second scheduler
July 2 - July 8: testing
July 9 - July 13: Mid-term Evaluations
July 9 - July 22: switch implementation to the second approach using periodic racct_set() iterating over all processes from racctd
July 23 - August 5: revising/improving the percentage calculation algorithm
August 6 - August 12: documentation, testing
August 13: End of coding (soft)
August 13 - August 19: documentation, testing
August 20: End of coding (hard)
Contact
Rudo Tomori - student
Edward Tomasz NapieraĆa - mentor
SVN repositary
Patches
FreeBSD-CURRENT http://www.ms.mff.cuni.cz/~tomor6am/racct-pcpu/racct_pcpu_current_oct_25_2012.patch
FreeBSD 9-STABLE http://www.ms.mff.cuni.cz/~tomor6am/racct-pcpu/racct_pcpu_releng_9_oct_25_2012.patch
Apply the patch as follows
cd /usr/src
patch -p1 < patch-file.patch
Required kernel options
options RACCT
options RCTL
Usage examples
rctl -a user:tom:pcpu:deny=60
- Adds a 60% cpu limit for user tom.
rctl -a process:1657:pcpu:deny=70
- Adds a 70% cpu limit for process with id 1657.