# PMM - PostgreSQL monitoring - Too many monitoring connections?

**URL:** https://forums.percona.com/t/pmm-postgresql-monitoring-too-many-monitoring-connections/15715
**Category:** PMM 2.x
**Tags:** pmm, postgres
**Created:** [May 17, 2022, 8:40am UTC](https://forums.percona.com/t/pmm-postgresql-monitoring-too-many-monitoring-connections/15715 "2022-05-17T08:40:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![elisetta1984](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/elisetta1984/32/5327_2.png) [@elisetta1984](https://forums.percona.com/u/elisetta1984)
#### Post date: [May 17, 2022, 8:40am UTC](https://forums.percona.com/t/pmm-postgresql-monitoring-too-many-monitoring-connections/15715/1 "2022-05-17T08:40:25Z")

</div>

Hello!

In the PostgreSQL log file, I see lots of opened connections executed by PMM to PostgreSQL instance.  
In this example, 312 connections in 1 minute:

2022-05-16 12:40:00.513 CEST [32620] LOG: connection authorized: user=pmm database=postgres SSL enabled (protocol=TLSv1.2, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256, compression=off)  
2022-05-16 12:40:00.536 CEST [32621] LOG: connection authorized: user=pmm database=postgres SSL enabled (protocol=TLSv1.2, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256, compression=off)  
2022-05-16 12:40:00.559 CEST [32622] LOG: connection authorized: user=pmm database=postgres SSL enabled (protocol=TLSv1.2, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256, compression=off)  
…

Is that a normal behavior or am I doing anything wrong in terms of monitoring configuration?  
Thanks and Best Regards

---

<div class="post-metadata">

### Author: ![Momo\_El](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/momo_el/32/6361_2.png) [@Momo\_El](https://forums.percona.com/u/Momo_El)
#### Post date: [May 24, 2022, 6:35am UTC](https://forums.percona.com/t/pmm-postgresql-monitoring-too-many-monitoring-connections/15715/2 "2022-05-24T06:35:52Z")

</div>

Hello

I have reported this issue previously and also opened an issue in JIRA

[https://jira.percona.com/browse/PMM-9957](https://jira.percona.com/browse/PMM-9957)

It seems there are progress toward integrating the latest version of prometheus exporter.

[https://jira.percona.com/browse/PMM-7806](https://jira.percona.com/browse/PMM-7806)

Best Regards

---

<div class="post-metadata">

### Author: ![elisetta1984](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/elisetta1984/32/5327_2.png) [@elisetta1984](https://forums.percona.com/u/elisetta1984)
#### Post date: [May 24, 2022, 9:45am UTC](https://forums.percona.com/t/pmm-postgresql-monitoring-too-many-monitoring-connections/15715/3 "2022-05-24T09:45:12Z")

</div>

Hello.  
Great, thanks!  
Best Regards,  
Elisa

---

<div class="post-metadata">

### Author: ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)
#### Post date: [May 24, 2022, 10:48pm UTC](https://forums.percona.com/t/pmm-postgresql-monitoring-too-many-monitoring-connections/15715/4 "2022-05-24T22:48:42Z")

</div>

Yes we are close to getting back in sync with upstream which could resolve this. But in the mean time one of our support team members found that by setting a connection limit for your PMM users to connect to postgres the issue can be at least worked around.

The prevailing theory is that the resolution is too high (meaning frequent scrapes) but the results of the previous scrape are still in flight causing a compounding of connections as each unfinished scrape causes the next one to take longer and so on.

you can try this `ALTER USER pmm CONNECTION LIMIT 10;` from [here](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/postgresql.html#create-a-database-account-for-pmm) or you might change your metrics resolution to something less frequent.

---

<div class="post-metadata">

### Author: ![elisetta1984](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/elisetta1984/32/5327_2.png) [@elisetta1984](https://forums.percona.com/u/elisetta1984)
#### Post date: [June 2, 2022, 2:49pm UTC](https://forums.percona.com/t/pmm-postgresql-monitoring-too-many-monitoring-connections/15715/5 "2022-06-02T14:49:35Z")

</div>

Thanks Steve! I will test this workaround waiting for the fix.  
Best Regards,  
Elisa
