The following example shows how you can use the various commands for resource quotas. The rule set shown in Example 6–4 defines the following limit:
All users together should never take more than 20 slots.
All users should take at most 5 slots on all Linux hosts.
Every user is restricted to one slot per Linux host except user MyUser who is restricted to two slots, and all other slots on hosts are restricted to 0.
The host group @linux includes host1 and host2.
To configure the rule set, use one of the following forms of the qconf command:
qconf -arqs <rule-set-name> for each rule set
qconf -arqs to run all rule sets at once
After jobs are submitted for different users, the qstat command shows output similar to the example shown in Example 6–5.
{ name maxujobs limit users * to slots=20 } { name max_linux limit users * hosts @linux to slots=5 } { name max_per_host limit users MyUser hosts {@linux} to slots=2 limit users {*} hosts {@linux} to slots=1 limit users * hosts * to slots=0 }
$ qstat job-ID prior name user state submit/start at queue slots ja-task-ID --------------------------------------------------------------------------------------------- 27 0.55500 Sleeper MyUser r 02/21/2006 15:53:10 all.q@host1 1 29 0.55500 Sleeper MyUser r 02/21/2006 15:53:10 all.q@host1 1 30 0.55500 Sleeper MyUser r 02/21/2006 15:53:10 all.q@host2 1 26 0.55500 Sleeper MyUser r 02/21/2006 15:53:10 all.q@host2 1 28 0.55500 Sleeper user1 r 02/21/2006 15:53:10 all.q@host2 1 |
$ qquota # as user MyUser resource quota rule limit filter -------------------------------------------------------------------------------- maxujobs/1 slots=5/20 - max_linux/1 slots=5/5 hosts @linux max_per_host/1 slots=2/2 users MyUser hosts host2 max_per_host/1 slots=2/2 users MyUser hosts host1 $ qquota -h host2 # as user MyUser resource quota limit filter -------------------------------------------------------------------------------- maxujobs/1 slots=5/20 - max_linux/1 slots=5/5 hosts @linux max_per_host/1 slots=2/2 users MyUser hosts host2 $ qquota -u user1 resource quota limit filter -------------------------------------------------------------------------------- maxujobs/1 slots=5/20 - max_linux/1 slots=5/5 hosts @linux max_per_host/1 slots=1/2 users user1 hosts host2 $ qquota -u * resource quota limit filter -------------------------------------------------------------------------------- maxujobs/1 slots=5/20 - max_linux/1 slots=5/5 hosts @linux max_per_host/1 slots=2/2 users MyUser hosts host1 max_per_host/1 slots=2/2 users MyUser hosts host2 max_per_host/1 slots=1/2 users user1 hosts host2 |