PMM - PostgreSQL monitoring - Too many monitoring connections?

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

2 Likes

Hello

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

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

Best Regards

2 Likes

Hello.
Great, thanks!
Best Regards,
Elisa

1 Like

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 or you might change your metrics resolution to something less frequent.

2 Likes

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

1 Like