Ad Widget

Collapse

Number of database connections

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicole
    Junior Member
    • Sep 2016
    • 10

    #1

    Number of database connections

    Hi

    So, I set up zabbix to monitor a few servers a while ago. I have 3 servers being monitored (zabbix server itself + 2), plus another separate host in the network.

    Today I ran netstat to see which connections were opened in the zabbix server, and I get 27 connections from zabbix server to my database server (which hosts postgresql). I would like to understand why the zabbix server needs to open so many connections.

    Thank you in advance.
  • brico
    Junior Member
    Zabbix Certified Specialist
    • Feb 2012
    • 10

    #2
    Taking a stab at this, but it may be related to the number of zabbix_server processes/sub-processes running on the system. With my default installation, I have a total of 27 zabbix_server processes running (1 parent, 26 children).

    Code:
    ps -ef |grep -v grep |grep zabbix_server|wc -l
    You may also be able to confirm this further by checking the process utilizing the connections by passing the -p switch into netstat (provided you're user root on Linux).

    Code:
    netstat -anp |grep zabbix_server

    Comment

    • guzzijason
      Senior Member
      • Dec 2015
      • 106

      #3
      If the connections are via unix domain sockets, netstat may not help - it will generally only show the server side (mysqld) of the socket connection, and not the client side.

      With that said, I tend to agree... the various connections are probably due to the number of zabbix child processes that require info from the database (which is probably all of them).

      __Jason

      Comment

      • peatb
        Zabbix Certified Trainer
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Aug 2016
        • 36

        #4
        Every zabbix process (every poller etc) uses it's own connection to the database, so you're right in saying that 27 processes will result in 27 connections.

        This is something to keep in mind when scaling up the number of processes. you might run into the connection limit of the database when you're going into the hundreds of processes (which can happen on large installations)

        Comment

        Working...