# Is there any way to limit the pmm connections to a database instance?

**URL:** https://forums.percona.com/t/is-there-any-way-to-limit-the-pmm-connections-to-a-database-instance/18125
**Category:** PMM 2.x
**Tags:** pmm
**Created:** [October 21, 2022, 3:27am UTC](https://forums.percona.com/t/is-there-any-way-to-limit-the-pmm-connections-to-a-database-instance/18125 "2022-10-21T03:27:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Luke03011](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/luke03011/32/16409_2.png) [@Luke03011](https://forums.percona.com/u/Luke03011)
#### Post date: [October 21, 2022, 3:27am UTC](https://forums.percona.com/t/is-there-any-way-to-limit-the-pmm-connections-to-a-database-instance/18125/1 "2022-10-21T03:27:39Z")

</div>

currently, I found in some cases (e.g. the database instance is stuck, so all query responses will be affected), the PMM agent uses too many connections, e.g.

```auto
+----------+----------------+---------------------+
| count(*) | user | ts |
+----------+----------------+---------------------+
| 306 | pmm | 2022-10-20 10:06:59 |
| 306 | pmm | 2022-10-20 10:07:07 |
| 306 | pmm | 2022-10-20 10:07:15 |
| 306 | pmm | 2022-10-20 10:07:23 |

```

the PMM agent issues more than 300 connections to the host it monitors, How to limit the number of connections PMM uses in case the PMM query response is delayed? It’s indeed a problem, this will make the server status even worse.

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [October 21, 2022, 3:28pm UTC](https://forums.percona.com/t/is-there-any-way-to-limit-the-pmm-connections-to-a-database-instance/18125/2 "2022-10-21T15:28:35Z")

</div>

Hello @Luke03011,  
If you follow [our documentation](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/mysql.html) you’ll see that the pmm user has a maximum of 10 connections. You should be able to alter the existing user you have created and limit the number of connections similar to as shown in our docs.

---

<div class="post-metadata">

### Author: ![Luke03011](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/luke03011/32/16409_2.png) [@Luke03011](https://forums.percona.com/u/Luke03011)
#### Post date: [October 22, 2022, 12:18am UTC](https://forums.percona.com/t/is-there-any-way-to-limit-the-pmm-connections-to-a-database-instance/18125/3 "2022-10-22T00:18:22Z")

</div>

Thanks for your quick response @matthewb
