Kernel config

Note: With newer kernels, the config of the currently running kernel can be found with `zcat /proc/config.gz | grep VSERVER`.

Context flag

Then check if the vserver you want to apply limits has the sched_hard context flag enabled by checking the contents of /proc/virtual/<xid>/status. The sched_hard flag is 0x00000100, so you have to find this value summed up in the vserver flag (see this message for details). If its not enabled, use the following command (more info here):

vattribute --set --xid <xid> --flag sched_hard

Setting the limits

Then you should be able to set the limits with a command like this one (more info here):

it's important to use the option --force so the limit is applied at the same time in the cpus. If you want to enable fair share (i.e, idle-time) for the vserver, make sure to use the --idle-time option at the previous command.

Then you should check at /proc/virtual/<xid>/sched (more info here). Try a command like

watch -n1 cat /proc/virtual/<xid>/sched

If the collum "Ticks spent on hold" is greater than zero and the flag "On hold (H) or running (R)" assumes the hold value, then its working :)

If you want to remove the scheduling, use the command

vattribute --set --xid <xid> --flag ~sched_hard

But remember that these instructions just cover setting limits in a running vserver. To save the values you choose please refer to the great flower page.