# Job Limit restriction on PBS

**URL:** <https://community.openpbs.org/t/job-limit-restriction-on-pbs/2960>\
**Category:** Users/Site Administrators\
**Created:** [February 10, 2022, 9:46am UTC](https://community.openpbs.org/t/job-limit-restriction-on-pbs/2960 "2022-02-10T09:46:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![punithm.iisc](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@punithm.iisc](https://community.openpbs.org/u/punithm.iisc)\
**Post date:** [February 10, 2022, 9:46am UTC](https://community.openpbs.org/t/job-limit-restriction-on-pbs/2960/1 "2022-02-10T09:46:14Z")

</div>

Hello All,

PBS configure for queue  
I’ve limited user jobs for a queue like this below,  
queue name: q1day\_small  
max\_queued = [o:PBS\_ALL=50]  
max\_queued += [u:PBS\_GENERIC=5]  
max\_run = [o:PBS\_ALL=50]  
max\_run += [u:PBS\_GENERIC=5]

As per the above limit, user jobs should be work for 5(running) + 5(queued)=10 jobs at a time  
But the user is able to submit 5 jobs irrespective of running or queue only.

Request anyone to give a solution to my query.

---

<div class="post-metadata">

**Author:** ![gabe](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@gabe](https://community.openpbs.org/u/gabe)\
**Post date:** [February 10, 2022, 12:18pm UTC](https://community.openpbs.org/t/job-limit-restriction-on-pbs/2960/2 "2022-02-10T12:18:51Z")

</div>

Running jobs are enqueued, so if you want the user to have 10 jobs in the queue (up to 5 of them running), you should set max\_queued to 10 and leave max\_run set to 5.

Gabe

---

<div class="post-metadata">

**Author:** ![punithm.iisc](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@punithm.iisc](https://community.openpbs.org/u/punithm.iisc)\
**Post date:** [February 11, 2022, 6:23am UTC](https://community.openpbs.org/t/job-limit-restriction-on-pbs/2960/3 "2022-02-11T06:23:47Z")

</div>

Hi Gabe,  
Thanks, I did, and it’s working.

---

<div class="post-metadata">

**Author:** ![bhroam](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/bhroam/32/20_2.png) [@bhroam](https://community.openpbs.org/u/bhroam)\
**Post date:** [February 11, 2022, 9:11pm UTC](https://community.openpbs.org/t/job-limit-restriction-on-pbs/2960/4 "2022-02-11T21:11:33Z")

</div>

Your other option is to use max\_queued\_threshold. This is more like what you originally wanted. It is the max number of jobs in a queue in the queued state. This means if a job runs, that user can submit another job into the queue.  
With what @gabe told you, a user can have a total of 10 jobs in the queue no matter the state. This means if there aren’t enough resources, they can have 10 queued jobs.

With max\_queued\_threshold in the case where resources aren’t available, they can have 5 jobs in the queue. When one starts running, another job can be queued.

It all depends on how you want to do this.

Bhroam

---

<div class="post-metadata">

**Author:** ![gabe](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@gabe](https://community.openpbs.org/u/gabe)\
**Post date:** [February 11, 2022, 9:32pm UTC](https://community.openpbs.org/t/job-limit-restriction-on-pbs/2960/5 "2022-02-11T21:32:45Z")

</div>

@bhroam Thanks for that clarification!

I usually combine limits like these with a routing queue. If the user is submitting jobs to the routing queue, and `max_queued_threshhold` is set on its destination execution queue, the user can keep submitting jobs to the routing queue (which, in my opinion, is more user-friendly) but only 5 of their jobs can trickle into the execution queue to possibly run.
