Connections are not closed properly, creates a lot of TCP reset (RST)
Hi,
We have been using libzbxpgsql for some time to monitor our clusters. Its great! However there is a problem.
Problem It would seem the module is not closing PG connections properly, or maybe at all, which creates a lot of undesired TCP RST noise on our deployments.
Environment
- Zabbix 3.4.2
- PostgreSQL 9.4.22
- {$PG_CONN} => host=127.0.0.1 user=postgres
- local connections are trusted via pg_hba
Is this behaviour per design ? Unfortunately I'm not versed in C, so can not refer to the src or issue a pull request.
Edit: Other than that, there do not seem to be problems retrieving metrics. It is all about how connections are closed.
This is definitely an issue and not by design. Currently the module has no intelligent handling of TCP connections. I do plan to implement connection pooling which will reuse connections and mitigate this issue. I'll keep this open until this can be resolved.