Linux – Decrease zabbix server connections to database

linuxpostgresqlzabbix

Is it possible to define a database pool value in order to decrease the database connections sent from zabbix server?

I saw a method when it was done through apache mod_fcgid, Shall it be done with mod mpm_prefork as well?

By doing tests (with only 2 users connected through web gui), I found 60 outgoing connections to database server when my limit in database server was 100, 23 when my limit was 20 (of course it didn't work) and with limit 30 I have 29 outgoing connections, Why such difference?

It seems to me that somehow, zabbix is able to identify the maximum number of database connections to create outgoing connections, but honestly that's a little strange for me, Zabbix seems to abuse of resources when I increase the pool in database server.

The scenario is a shared PostgreSQL server, that's why increasing pools in database server side is not a good idea in my case.

Zabbix is installed in a CentOS 7 server.

Best Answer

Most likely, you are seeing connections from the server. Many server processes will keep their own connection. Making the limits low will cause issues, do not do that - processes will have issues connecting, reconnect, the connections will be opened and closed more often.

Your options are:

  • Increase the DB connection limit until there are spare connection slots.
  • Decrease the number of spawned Zabbix server processes (like pollers) until there are spare connection slots.

In general, putting Zabbix DB on a shared resource is not a good idea - that makes your monitoring system unreliable when production load increases or there are any other issues.