"The Perfect Server" - but why prefork for Apache?

Discussion in 'HOWTO-Related Questions' started by talkingnews, Feb 22, 2011.

  1. talkingnews

    talkingnews New Member

    I installed "The Perfect Server" on my 512Mb RAM Ubuntu 10.10 VPS following this excellent guide.

    http://www.howtoforge.com/perfect-server-ubuntu-10.10-maverick-meerkat-ispconfig-3-p4

    But it says:

    And sure enough, if I run apache2 -l I get:

    Code:
    Compiled in modules:
      core.c
      mod_log_config.c
      mod_logio.c
      prefork.c
      http_core.c
      mod_so.c
    I've had continuing memory and resource issues whatever I tweaked, and then I saw the following guide:

    http://www.devside.net/articles/apache-performance-tuning

    Excuse my newbie-ish questions, but after having had a good poke around, I'm still not sure if and how I can swap the running versions of Apache.

    I just want to try running worker instead of prefork for a day or two to see how it goes. How can I achieve this? Thank you!
     
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    I guess the most likely reason for your problems is the very low RAM of your VPS and not the apache threading module. For a full featured server like it is sinstalled in the perfect setup guide, you should have at least 2 GB RAM.
     
  3. talkingnews

    talkingnews New Member

    Hmm, but this, I don't understand. All the mail features are turned off, and I saw this post:

    So if he has 4G RAM and it's 100 times more than he needs, surely 512Mb RAM is enough for a simple, low-volume local town forum running on phpbb with a max of about 20 users online at any one time?

    So are you saying that swapping to worker, which the other guide says uses less RAM, would not help me then?
     
  4. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Thats not the case. You can not simply break down the numbers mathematically on a request per megabyte ram basis as there is a minimum ram rquirement for apache to work properly and for the kernel to keep files cached instaed of loading them from disk for every request.

    Yes, thats what I'am saying. Switching to worker might be on option for a server that runs a single website with mod_php and has high traffic or uses .html and not script files, as it helps apache to scale better under high load. But I dont expect that this will make much difference on a small setup like yours.

    But feel free to try it. Just make sure that you backup your system in case that this breaks the setup as mpm-worker might cause issues with PHP. To install mpm-worker, use this command:

    apt-get install apache2-mpm-worker
     
  5. talkingnews

    talkingnews New Member

    OK, thanks and thumbs up for the good, clear explanation. I might have to "fork" out for more memory then, but with a VPS it can mount the costs up.

    So let's say I double the ram to 1Gb, and I get another webmaster with a similar sized site to share the hosting costs (with him as a separate user/client etc in ISPconfig) am I just going to be back to square one?

    In other words, if 512Mb is only just enough to run 1 small-ish site, if I double my costs and RAM and have two smallish sites and 1Gb RAM, am I shooting myself in the foot? Or does the overall memory usage not work like that?
     
  6. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Yes, it does not work like that. As I explained above, you can not calculate the ram amount in that way.
     

Share This Page