Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2006

    Medium traffic site: Apache memory usage

    Hello everyone,

    I have a medium traffic site with a small and light PHP application (a remotely hosted service). Apache currently takes up to 480mb of memory. Along with MySQL and other services running, I have around 150mb of RAM left. No swap yet.

    What concerns me is that I am a bit clueless of what is "normal" for Apache and what is not because search results don't come up with much info. It is probably hard to compare but I just wanted to know how my system performs compared to other dedicated servers with active sites.

    I need something to compare to before I can work on with further optimizations. I've done all that I could at the moment.

    Here are some of my server's info:

    P4 D930
    1GB RAM
    Apache 2.2.3
    PHP 5.2.0
    MySQL 5

    70k-100k impression daily
    Serve mainly PHP pages and small images
    No heavy processing, just small pages
    No accelerator or optimizer
    (it was using 600mb+ when Zend optimizer enabled)

    Any info or idea on the memory usage is much appreciated!

  2. #2
    Why don't you try APC or eaccelerator to optimize your php scripts?

    edit: I am sorry that APC does not available for windows
    Last edited by fitesun; 12-07-2006 at 01:01 PM.

  3. #3
    Join Date
    Dec 2006
    Thanks for your input. I have not tried both the option you have mentioned but PHP caching with Zend Optimizer did not do any good earlier. It only increased the memory usage.

    I am not sure if using APC or eaccelerator can actually cut down my memory usage even though it will increase the script performance. At the moment I have no problem with the performance of my PHP scripts, only memory usage of Apache is what I'm concerned with.

    I have coded all the PHP scripts myself and they have been optimized for high performance, as much as I could.

    I will try out both PHP caching options on my test servers and see how it goes with the memory usage. Your input is much appreciated.

  4. #4
    How many module do you load for Apache? with many module apache will deplete the memory.
    As I thought:with more optimizer,you get more memory left.

  5. #5
    Join Date
    Dec 2006
    I have only the following modules for Apache:

    - php5_module
    - authz_host_module
    - dir_module
    - log_config_module
    - mime_module
    - rewrite_module

    I have disabled logging as well as other unnecessary options to improve performance.

    So back to my original question, can my Apache memory usage be considered normal?

    I hope someone with similar conditions might be able to share some details so I can have something to compare to. Any info or help is much appreciated.

  6. #6
    Join Date
    Dec 2005
    United Kingdom, Liverpool
    Have you tried another httpd program? such as LightHttpd or Abyss Webserver? They tend to use less memory than apache
    Linux/Windows Technician
    JCulpin [at]

  7. #7
    Join Date
    Jan 2005
    That is normal, We have about 250K impressions/day on our Win2k3 machine with Apache installed and there is about the same consumption of RAM, It's increasing every day a bit, I suggest you to stop/start apache e.g. 2 times/week. Simple restart doesn't help because memory is not released. So schedule simple bat file that will do the job for you.

  8. #8
    Join Date
    Dec 2004
    New York, NY
    If you're running Windows, you would be best running IIS and not Apache.

  9. #9
    Join Date
    Jan 2005
    I personally tried to run IIS with PHP on W2K3 but there were some problems with redirections and header issues. Also if somebody uses lot of mods like mod_rewrite and so on, IIS is not the right way. You have to pay for more than 50% useful ISAPI filters.

  10. #10
    Join Date
    Dec 2006
    I have tried to learn lighttpd after reading some of the threads around but it seems like there are many new things to learn. Being quite advanced with Apache and its configuration, starting a new server for my dedicated service feels kind of "insecure" to me, since I am fairly new with other webservers.

    However, I will definitely seek more info on these alternatives and see how it goes. Just prefer to stick to Apache since I have more (most) control with it.

    Thanks! That's good to hear, at least I know mine is not too far from normal. Thanks for the suggestion too!

    At the moment my Apache memory usage kinda drops a bit sometimes, up and down. When it goes up to 2 weeks uptime I will definitely see how it performs.

    A simple restart ain't working properly on my side too.

    Thanks for the suggestion. I have more experience with Apache than any other webservers and my knowledge on IIS is nil.

  11. #11
    Join Date
    Dec 2006
    I changed PHP to work as FastCGI instead of Apache module. Managed to cut about 400mb of RAM just with that. Also used eAccelerator, which improved the performance quite a bit. It is way more stable than before, no crashes so far and performing much faster.

    Just thought that these info would be helpful to some newcomers out there, especially those with busy site on Apache 2.2.3, PHP 5.2.0 and Win2k3.

Posting Permissions

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