# RESOURCE\_EXHAUSTED: namespace count limit exceeded

**URL:** <https://community.temporal.io/t/resource-exhausted-namespace-count-limit-exceeded/5974>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [September 14, 2022, 11:12pm UTC](https://community.temporal.io/t/resource-exhausted-namespace-count-limit-exceeded/5974 "2022-09-14T23:12:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maggie](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@Maggie](https://community.temporal.io/u/Maggie)\
**Post date:** [September 14, 2022, 11:12pm UTC](https://community.temporal.io/t/resource-exhausted-namespace-count-limit-exceeded/5974/1 "2022-09-14T23:12:21Z")

</div>

Hi,

Getting error “RESOURCE\_EXHAUSTED: namespace count limit exceeded” in staging env but not in prod env. The value for maxConcurrentWorkflowTaskPollers is defined as 80 and maxConcurrentActivityTaskPollers is also defined as 80. And the `frontend.namespaceCount` is set s 20000. And frontend has 5 instances.

However, when checking the number of polls (from `service_pending_requests ` metrics) based on this [post](https://community.temporal.io/t/frontend-namespacecount-attribute/4879/2), we find the `service_pending_requests` is around 300, which is far lower than 20000 we set.

Can someone please explain what causes “too many concurrent polls for workflow/activity tasks” in this situation? Thanks

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [September 15, 2022, 5:02am UTC](https://community.temporal.io/t/resource-exhausted-namespace-count-limit-exceeded/5974/2 "2022-09-15T05:02:51Z")

</div>

frontend.namespaceCount is per frontend host, do you have it set on each of the 5? (assume you have ingress / LB in front of them, maybe could check if its maybe routing all calls to single one?).

Also look at resource exhausted server metric:  
`sum(rate(service_errors_resource_exhausted{}[1m])) by (resource_exhausted_cause)`  
and check the causes.

In WorkerOption do you set MaxConcurrentWorkflowTaskPollers, MaxConcurrentActivityTaskPollers? How many workers do you have?
