Ad Widget

Collapse

zabbix server strange memory behaviour

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pstoman
    Junior Member
    • Jul 2010
    • 4

    #1

    zabbix server strange memory behaviour

    Hi folks,

    I've installed Zabbix 1.8.2 some 20 days ago on Debian 5.0.5 (lenny). It runs as a vitual machine in ESXi 3.5 with 1vCPU and 1GB of RAM.

    Everything was fine for first few days (see the graph) but then memory started to go wild, and on two or three occasions server became totaly unresponsive after consuming all the swap. On the end oom kicked in and killed zabbix-server.

    I have rather small setup, only one Linux host is monitored so far beside Zabbix server itself, and additionaly I've set-up a simple ping check for 17 devices.

    Frankly I don't know where to start looking for the problem, so any help will be appreciated.


    Regards

    Petar

    Click image for larger version

Name:	zabbix_server_memory.jpg
Views:	1
Size:	118.1 KB
ID:	315514
  • pstoman
    Junior Member
    • Jul 2010
    • 4

    #2
    Apache is the problem

    I just catched my server consuming all the swap again and found out that there is some problems with apache2. After apache restart almost all the RAM and swap was "dealocated.
    Now I just need to figure out why apache behaves like that.

    I will appreciate if someone had a similar problem and can share some info.

    Regards

    Petar

    Comment

    • alixen
      Senior Member
      • Apr 2006
      • 474

      #3
      Hi,

      I have not seen it with Zabbix (yet) but I've seen it at some Web sites that serve dynamic content with PHP or Perl Apache modules.

      Apache default configuration is good for serving static content but can eat a lot of memory with dynamic content.

      You should look at /etc/apache2/apache2.conf, default configuration looks like:
      Code:
      <IfModule mpm_prefork_module>
          StartServers          5
          MinSpareServers       5
          MaxSpareServers      10
          MaxClients          150
          MaxRequestsPerChild   0
      </IfModule>
      MaxClients = 150 means that, at worst, you can have 150 apache processes at the same time. Since each one may use at least 10 to 20 MB, you'll need 1,5 to 3 GB just for them.

      MaxRequestsPerChild=0 means that apache processes will serve requests for ever. Since some PHP requests may need a lot of memory, these processes will grow and never return allocated memory. A non 0 value forces Apache to stop the process after some requests and start a new one then freeing all memory of the old one.

      I suggest :
      • MaxClients :reduce it, 30 should be OK unless you have a lot of users (in this case, you should consider also allocating more RAM).
      • MaxRequestsPerChild: use a non 0 value (10 is a good start)


      Regards,
      Alixen
      http://www.alixen.fr/zabbix.html

      Comment

      • pstoman
        Junior Member
        • Jul 2010
        • 4

        #4
        Thanks Alixen, you helped me alot.

        I've changed some of my apache configuration and for the time being it looks good.

        Regards

        Petar

        Comment

        Working...