# Limit on resources per user/group

**URL:** <https://community.openpbs.org/t/limit-on-resources-per-user-group/425>\
**Category:** Users/Site Administrators\
**Created:** [January 30, 2017, 4:13pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425 "2017-01-30T16:13:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sscluster](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@sscluster](https://community.openpbs.org/u/sscluster)\
**Post date:** [January 30, 2017, 4:13pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/1 "2017-01-30T16:13:49Z")

</div>

I am trying to implement some resource limitations for users or groups. I only want to limit the maximum number of CPUs that a user can consume in total, not per job. For example:

USERA = 4 CPUs  
USERB = 16 CPUs

GROUPA = Each member can use up to 64 CPUs

Is using fairshare with the following formula the best path for accomplishing this task or is there an easier way with qmgr:

fairshare\_usage\_res: ncpus\*walltime

Thank you,

SS

---

<div class="post-metadata">

**Author:** ![arungrover](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/arungrover/32/40_2.png) [@arungrover](https://community.openpbs.org/u/arungrover)\
**Post date:** [January 30, 2017, 5:03pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/2 "2017-01-30T17:03:26Z")

</div>

@sscluster It depends what kind of limits you want to put in your complex. There are majorly two kinds of limits that you can apply in PBS - queued limits and run limits.

If you wish to limit userA from submitting any more jobs when it has already requested for 4 CPUs previously then you may want to use queued limits.  
example - qmgr -c "s s max\_queued\_res.ncpus=[u:userA=4]"  
If you want userA to continue submitting jobs but want to restrict this user from not using more than 4 cpus at a time then you might want to use run limits.  
example - qmgr -c “s s max\_run\_res.ncpus=[u:userA=4]”

These limits can be applied to server or a specific queue as well.

For more details please refer to section “5.15” related to “Managing Resource Usage” in admin guide - [here](http://www.pbsworks.com/pdfs/PBSProAdminGuide13.1.pdf).

---

<div class="post-metadata">

**Author:** ![prakashcv13](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/prakashcv13/32/65_2.png) [@prakashcv13](https://community.openpbs.org/u/prakashcv13)\
**Post date:** [January 30, 2017, 5:03pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/3 "2017-01-30T17:03:44Z")

</div>

Hi SS,

I would suggest using max\_queued\_res.ncpus for this.  
Information on the same is available in Administrator guide. Please let me know if you need further information.

Thanks,  
Prakash

---

<div class="post-metadata">

**Author:** ![sscluster](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@sscluster](https://community.openpbs.org/u/sscluster)\
**Post date:** [January 30, 2017, 5:25pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/4 "2017-01-30T17:25:57Z")

</div>

Thank you all for the suggestions. I will use try to use the max\_queued\_res.ncpus and see how it goes.

SS

---

<div class="post-metadata">

**Author:** ![jon](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/jon/32/23_2.png) [@jon](https://community.openpbs.org/u/jon)\
**Post date:** [January 30, 2017, 6:01pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/5 "2017-01-30T18:01:03Z")

</div>

I don’t think you are looking for max\_queued\_res.ncpus. This limits how many ncpus can be queued or running. I believe that you are looking for max\_run\_res.ncpus. This will limit a user to only be able to run a certain number of ncpus without also restricting the number of ncpus sitting in the queue.

---

<div class="post-metadata">

**Author:** ![sscluster](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@sscluster](https://community.openpbs.org/u/sscluster)\
**Post date:** [January 30, 2017, 7:31pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/6 "2017-01-30T19:31:08Z")

</div>

@jon, @arungrover, @prakashcv13  
It seems as though max\_queued\_res.ncpus is a server variable that can only be set once. How do I set it for mutliple users?

---

<div class="post-metadata">

**Author:** ![arungrover](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/arungrover/32/40_2.png) [@arungrover](https://community.openpbs.org/u/arungrover)\
**Post date:** [January 30, 2017, 7:40pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/7 "2017-01-30T19:40:15Z")

</div>

@sscluster you can specify multiple such limits using “+=” operator.

I’d recommend reading the admin guide section “5.15” . It has a lot of examples that might be helpful to you.

---

<div class="post-metadata">

**Author:** ![sscluster](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@sscluster](https://community.openpbs.org/u/sscluster)\
**Post date:** [January 30, 2017, 7:54pm UTC](https://community.openpbs.org/t/limit-on-resources-per-user-group/425/8 "2017-01-30T19:54:04Z")

</div>

@arungrover,  
Works now. Forgot about the += operator for server variables.

-Sajesh-
