This is an old revision of the document!


Memory Limits

CPU Limits

CPU limiting is implemented by giving each jail a (user-changeable) number of CPU shares and tracking the estimated CPU usage of the tasks that run in that jail. If the ratio of the jail's estimated CPU usage to total CPU usage exceeds the ratio of the jail's CPU shares to total CPU shares outstanding, the jailed processes have their priorities decreased until the ratio of actual usage (estimated CPU) drops below permitted usage (shares). Unjailed processes are not subject to this regime.

This system does not prevent a jailed process from monopolizing the CPU when there are no other runnable processes; rather, it only prevents a jail from using more CPU time than its share if there are other jailed processes (in which case they will tend to share CPU time in proportion to their respective CPU share allocations).

Future work could look at implementing a full-blown fair-share scheduler (see Kay & Lauder or Waldspurger).

To-do List

  • Implement memory limits in kern_jail.c [done, except memory limiter doesn't stop trying to page a jail's processes out when it drops below the threshold]
  • Implement CPU share limiting in sched_hier.c [done, except debug info needs removing]
  • jtune program to modify CPU and memory limits on running jails
  • Write / update man pages for jtune, jail
  • Make memory limiter stop paging when jail is under limit
  • Port from RELENG_6 to -CURRENT [post-SoC?]
  • jailresourcelimits.1155977122.txt.gz
  • Last modified: 2006/08/19 08:45
  • by ChrisJones