libzbxpgsql icon indicating copy to clipboard operation
libzbxpgsql copied to clipboard

Connections are not closed properly, creates a lot of TCP reset (RST)

Open jpuris opened this issue 6 years ago • 1 comments

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.

jpuris avatar Jun 16 '19 17:06 jpuris

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.

cavaliercoder avatar Jun 22 '19 10:06 cavaliercoder