Find the answer to your Linux question:
Results 1 to 4 of 4
I've been recently having issues with Apache webserver. I found my server frozen, because It had no RAM and Swap memory left. Somehow I managed to log in to SSH ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    2

    Apache takes all memory


    I've been recently having issues with Apache webserver. I found my server frozen, because It had no RAM and Swap memory left. Somehow I managed to log in to SSH and find out where the problem is. I can't understand what could cause this.

    screenshot: img850.imageshack.us/img850/2167/apacheoverload.jpg

    How could I limit Apache2 to not use all available resources?

    Thanks!

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,392
    Depending on the MPM, you can limit the started servers and the maximum number of clients.
    But looking at your htop output, you would need to limit the maximum number of clients to three, which is a bit low.

    I guess, it is not really apache but the application it serves that goes amok.
    Multiples scenarios are possible:
    1) maybe the app has a memory leak
    2) maybe the app really does need that much memory by design.
    Then I would question the design or re-read the suggested system requirements.
    3) maybe the app can be configured to work in smaller chunks

    The first two cases call for developer work, the latter for config changes.

    Im only guessing of course.
    A more detailed inspection would be needed.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Aug 2011
    Posts
    2
    Yes it's possible that app have some logical errors. Because this isn't happening exactly after starting webserver, this happened only few days later. I think that Apache starts more processes and they keep running in memory.

    I guess that this could also be caused by DoS attack.

    I'll take a look at app code, it's relatively small website, developed by non-professional


    Thanks For your fast reply!

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,392
    If you have monitoring in place, like nagios or xymon, then you would be able to see the memory consumption on a timeline.
    Here is an example
    green : Xymon - Status @ Sat Aug 13 20:29:24 2011
    You must always face the curtain with a bow.

Posting Permissions

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