Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Lenny apache/php memory issues

  1. #1
    Join Date
    Feb 2007
    Posts
    17

    Unhappy Lenny apache/php memory issues

    Upgraded one of my servers yesterday from etch to lenny and immediately found myself running out of RAM. I've got a fair number of Drupal sites on this (VPSLink4) server, but they're all low-traffic and I've never had a single white screen of death on this server the whole time I've had it.

    I found that after the upgrade each apache process was using 2-3 times the memory it had been using on etch. This seems to be a known issue: #485413 - apache2: Apache crashes system due to exessive memory allocation - Debian Bug report logs

    I've worked around it, at least to the point where I can't DoS myself with four Firefox tabs, by punching some very low numbers into apache.conf:

    <IfModule mpm_prefork_module>
    StartServers 2
    MinSpareServers 2
    MaxSpareServers 4
    MaxClients 8
    MaxRequestsPerChild 16
    </IfModule>

    ... but I'm worried about what that will do to performance. Does anybody with experience with this have a recipe they can share?

  2. #2
    Join Date
    Jul 2009
    Location
    New York
    Posts
    465

    Default

    I've been experiencing a problem with ram issues too. funny thing is the problem I found was the php opcode used. I doubt it is apache. Drupal itself took around 48mb to run when I put all the modules in and it was just me on doing testing on the server.

  3. #3

    Default

    I would seriously consider these alternatives:

    Lighttpd
    Nginx
    Nginx (static file serving) + Apache (back end PHP processing)

    All three use a far lower amount of memory than Apache alone. I personally am using Lighttpd and the only frustration is Clean URL's, especially with Drupal.

  4. #4
    Join Date
    Mar 2008
    Posts
    142

    Default

    I'll throw my hat into this ring too only I've had to use

    <IfModule mpm_prefork_module>
    StartServers 1
    MinSpareServers 2
    MaxSpareServers 5
    MaxClients 30
    MaxRequestsPerChild 100
    </IfModule>

    to get a manageable load, if more then 2 people make a request for the home page to a single wp blog it can still run out of memory.

    If anyone has a suggestion I'm all ears!

    also alma what's you're keepalive set to?

  5. #5
    Join Date
    Jul 2007
    Location
    127.0.0.1
    Posts
    392

    Default

    Quote Originally Posted by SomeoneE1se View Post
    If anyone has a suggestion I'm all ears!
    I second what others have said. Install Lighttpd and your problem will no longer exist.

    Lighttpd/MySQL/php/stunnel/djbdns on a Link4 hosting 20-25 dynamic sites (mostly wordpress):
    Code:
    [nullamatix ~]:# free
    VPS Memory:
      total: 512 mb   used: 220 mb (42%)   free: 292 mb
    [nullamatix ~]:#
    Lighttpd/MySQL/php/stunnel/openvpn on a Link6 hosting several databases exceeding 1mil records:
    Code:
    [477][vps6 ~]:# free
    VPS Memory:
      total: 1857 mb   used: 899 mb (48%)   free: 958 mb
    [478][vps6 ~]:#

  6. #6
    Join Date
    Mar 2008
    Posts
    142

    Default

    I'd hate to move away from lamp.

    But I might have to if apache can't get this fixed. Time to pull out the documentation for lighttpd and see if I can't get everything working on it.

  7. #7
    Join Date
    Mar 2008
    Posts
    142

    Default

    From what I've been reading lighttpd is better with static content. I think I have a total of 5 static pages in all of the sites I'm running. Do you still suggest the switch?

  8. #8
    Join Date
    Jul 2007
    Location
    127.0.0.1
    Posts
    392

    Default

    Quote Originally Posted by SomeoneE1se View Post
    Time to pull out the documentation for lighttpd and see if I can't get everything working on it.
    I've administered Apache web-server for many years (mainly for small, internal/personal projects), and still unwillingly have to administer several Apache servers at work. But I can assure you, the transition to Lighttpd is a breeze, and probably one of the more fun and beneficial projects I've embarked on. The config syntax for Lighttpd is brilliant, the performance is fantastic, there's a boat-load of modules to extend functionality, and the creators didn't rip the name of a Native American tribe

    I'll help you as best I can with any problems or issues you run into, just post here or shoot me PM. Also have a PGP key if you're a security conscious fellow

  9. #9
    Join Date
    Jul 2007
    Location
    127.0.0.1
    Posts
    392

    Default

    Quote Originally Posted by SomeoneE1se View Post
    Do you still suggest the switch?
    Yes - I've read a few posts hear and there where Apache users were using Lighttpd to serve up their static content (js, css, images, etc). I find that Lightty works great for both static & dynamic content.

  10. #10
    Join Date
    Feb 2007
    Posts
    17

    Default

    Quote Originally Posted by SomeoneE1se View Post
    also alma what's you're keepalive set to?
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15

    ... which I think is the default.

    Thanks to everyone for confirming it's not just me.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •