Out of memory

Discussion in 'Server Operation' started by SamTzu, Jul 8, 2009.

  1. SamTzu

    SamTzu Active Member

    *Fatal error*: Out of memory (allocated 8912896) (tried to allocate
    311296 bytes) in
    on line *1785*

    My Proxmox/OpenVZ containers keep getting these 'Out of Memory' errors too regularly. It is really annoying.

    My web servers are based on debian-5.0-standard_5.0-1 Proxmox template and The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3] Version 1.1 http://www.howtoforge.com/perfect-se...nny-ispconfig3


    Moving to Proxmox v 1.3 helped a little.
    Any ideas how to improve the situation or should I just quit OpenVZ and move to KVM?
  2. Mark_NL

    Mark_NL Member

    Crank up the available memory a php thread may use a bit and your problem should be solved. php5 defaults sets it to 128MB nowadays .. it was 8 before. 8912896 is ~ 8MB :p

    set it higher in your php.ini or if you may you can put it in an .htaccess file.
  3. SamTzu

    SamTzu Active Member

    It's the default 128MB now.
    It would not be a problem if it did not halt the whole server just the offending website.

    I have been considering some kind of cron job to restart apache but that would really just avoid the real issue with memory handling.
  4. Mark_NL

    Mark_NL Member

    So it was already set to 128MB?

    check phpinfo(); from the running website, maybe it overwrites the default setting to a lower one.
  5. SamTzu

    SamTzu Active Member

    I don't really care if one site on the server max's out. As long a the server keeps running. But if memory consumption kill all other sites then it's a problem.

    The underlying Proxmox/OpenVZ seems to stuck the Virtual container if its memory is maxed out. This causes ALL the sites on the server to give out 'Out of memory' error. That is not good.
  6. SamTzu

    SamTzu Active Member

    Load Testing website

    I found a very good way to stress test a web site/server.
    Install a JCrawl to your website and run it. (Two times if you can.)

    Here is my test server config.
    Proxmox v.1.3
    Based on debian-5.0-standard_5.0-1 Proxmox template.
    The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3]
    Version 1.1
    Author: Falco Timme
    Skipped pages 1-35. (Server setup.)

    (+ apt-get install curl php5-curl)
    1023 MEM / 2024 Swap
    128Mb PHP

    Joomla 1.5.11 website with JCrawl.
    (fast-cgi, SuExec, SSI, CGI)

    Run JCrawl on your site...
    (Looks like the fast-cgi does not kill it's processes, I'd rather use suPHP but then Joomla does not install components properly.)

    My test results after second try...

    Fatal error: Out of memory (allocated 7864320) (tried to allocate 1729038 bytes) in /var/www/clients/client3/web2/web/administrator/components/com_jcrawler/admin.jcrawler.php on line 800

    Warning: (null)(): 121 is not a valid cURL handle resource in Unknown on line 0

    Warning: (null)(): 122 is not a valid cURL handle resource in Unknown on line 0

    ...and the server folded. I had to manually reboot it before apache got back on it's feet again.
    Not good.
    Last edited: Jul 8, 2009
  7. Mark_NL

    Mark_NL Member

    So we can savely say: That's some crappy code they wrote! :)
  8. SamTzu

    SamTzu Active Member


    I wonder how it can be since Proxmox team claims to use only OpenVZ code and OpenVz should be mature product. I understand that commercial products like Virtuozo are based on it.
  9. SamTzu

    SamTzu Active Member

  10. SamTzu

    SamTzu Active Member

    Ok. After more digging in to the problem I traced it to this folder...

    After changing the file ownerships to ispconfig:ispconfig the fast-cgi memory problems went away :)

    Now all I have to do is find what is wrong with the Debian OpenVZ container memory management.

Share This Page