Ad Widget

Collapse

zabbix server dies with mysql max_user_connections problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jrm
    Junior Member
    • Aug 2009
    • 3

    #1

    zabbix server dies with mysql max_user_connections problem

    I have a new Zabbix install (I've not installed Zabbix previously) using version 1.6.5. The server keeps dying with the following error:

    31958:20090819:111943 [Z3001] Connection to database 'zabbix' failed: [1203] User zabbix already has more than 'max_user_connections' active connections

    I keep upping the max_user_connections limit in my.cnf but the problem just keeps happening. I've currently got it at 200. (I started with the default.)

    I've noticed by using show processlist that the number of zabbix processes just keeps growing over time.

    I'm monitoring about 10 systems.

    Any suggestions as to where I should look to solve my problem?
  • alj
    Senior Member
    • Aug 2006
    • 188

    #2
    Originally posted by jrm
    I have a new Zabbix install (I've not installed Zabbix previously) using version 1.6.5. The server keeps dying with the following error:

    31958:20090819:111943 [Z3001] Connection to database 'zabbix' failed: [1203] User zabbix already has more than 'max_user_connections' active connections

    I keep upping the max_user_connections limit in my.cnf but the problem just keeps happening. I've currently got it at 200. (I started with the default.)

    I've noticed by using show processlist that the number of zabbix processes just keeps growing over time.

    I'm monitoring about 10 systems.

    Any suggestions as to where I should look to solve my problem?
    Your total number of database connections will be number of pollers + number of trappers + pingers + smtp pollers + other zabbix workers (all configurable via zabbix server config) + max number of apache children in your www frontend.

    You probably had too many people browsing zabbix graphs and they are all used all awailable mysql connections.
    Please calculate all those numbers carefully so they never trip over mysql limit and you wont have this problem.


    About number of processes - that is weird. My server always forks number of processes equal to total number of workers + 1 right from start. Of course they all want each own mysql connection.
    NUmber of apache children however is dynamic and depends on how many users browse site.

    Comment

    • jrm
      Junior Member
      • Aug 2009
      • 3

      #3
      After raising the max_user_connections from 100 to 200 yesterday the server processes have remained up and for my config show processlist in mysql has settled in at around 115 process for zabbix. How do I get the various numbers (pollers, trappers, pingers, etc.) for the calculation you outline?

      Comment

      • alj
        Senior Member
        • Aug 2006
        • 188

        #4
        Originally posted by jrm
        After raising the max_user_connections from 100 to 200 yesterday the server processes have remained up and for my config show processlist in mysql has settled in at around 115 process for zabbix. How do I get the various numbers (pollers, trappers, pingers, etc.) for the calculation you outline?
        Look at the zabbix_serverd config and add them together.

        I also recommend you run web frontend from under fcgid application and set limit on max number of php processes there.
        This way you can have lots of users go to frontend and small and limited number of database connections from web frontend.


        Heres my example of zabbix web config under Debian apache 2.2 (threaded) with max number of web connections equal to 30:
        DefaultInitEnv PHP_FCGI_MAX_REQUESTS 5000
        MaxProcessCount 30
        BusyTimeout 300
        <Directory /usr/share/zabbix>
        Options ExecCGI
        AddHandler fcgid-script .php
        FCGIWrapper /usr/bin/php5-cgi .php
        Order allow,deny
        allow from all
        </Directory>
        Alias /zabbix /usr/share/zabbix

        Comment

        • jrm
          Junior Member
          • Aug 2009
          • 3

          #5
          Thanks for the help and suggestions. After now running for 4-5 days the number of mysql processes associated with zabbix has settled down to a much more reasonable 17 or so. Was the initial high number of processes due to some initial setup and/or configuration activity?

          Comment

          Working...