Main Issue: frequent connection drops are occurring to certain databases connected to PMM. The drop is happening because the connect timeout value is not long enough for the current setup to establish a connection.
The PostgreSQL logs confirm the issue: PMM is disconnecting too early due to connect_timeout=1.
What the PostgreSQL logs show
-
SSL negotiation failure:
- PMM opens a connection and requests SSL
- PMM disconnects before PostgreSQL can send the SSL response
- Error: “failed to send SSL negotiation response: Broken pipe”
-
Data transfer interruption:
- PMM connects and sends a query
- PostgreSQL starts sending results
- PMM disconnects during the transfer
- Error: “could not send data to client: Broken pipe”
Why this happens
With connect_timeout=1 (1 second):
- Network latency over Azure Private Link: ~50–200ms
- SSL handshake: ~100–300ms
- Total: can exceed 1 second
- Result: PMM disconnects before the SSL handshake completes
Evidence chain
| Source | Evidence |
|---|---|
| PostgreSQL logs | SSL negotiation failures, broken pipe errors |
| PMM logs | connect_timeout=1 in connection strings, i/o timeout errors |
| Azure metrics | Byte dips (connections dropping/reconnecting) |
| Pattern | PMM disconnects during SSL handshake and data transfer |
Logs
From pmm-agent.log
time="2026-03-05T15:51:57.348+00:00" level=error msg="ts=2026-03-05T15:51:57.348Z caller=datasource.go:107 level=error msg=\"Error opening connection to database\" dsn=\"postgres://***:PASSWORD_REMOVED@10.121.128.53:5432/postgres?connect_timeout=1&sslmode=disable\" err=\"read tcp 10.121.128.49:38450->10.121.128.53:5432: i/o timeout\"" agentID=689c475e-3416-4978-83b1-1b317bd37e76 component=agent-process type=postgres_exporter
From Target DB:
1- "failed to send SSL negotiation response: Broken pipe"
2- user=reader,db=postgres,app=[unknown], client=10.102.89.130LOG: could not send data to client: Broken pipe
Is there any way to increase the connect_timeout value to larger than 1s?