Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd February 2011, 17:33
talkingnews talkingnews is offline
Member
 
Join Date: Jan 2011
Posts: 65
Thanks: 15
Thanked 5 Times in 5 Posts
Default "The Perfect Server" - but why prefork for Apache?

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

http://www.howtoforge.com/perfect-se...ispconfig-3-p4

But it says:

Quote:
aptitude install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils ...etc
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/apac...ormance-tuning

Quote:
Chose the right MPM for the right job:

prefork [default MPM for Apache 2.0 and 1.3]:
Apache 1.3-based.
Multiple processes, 1 thread per process, processes handle requests.
Used for security and stability.
Has higher memory consumption and lower performance over the newer Apache 2.0-based threaded MPMs.

worker:
Apache 2.0-based.
Multiple processes, many threads per process, threads handle requests.
Used for lower memory consumption and higher performance.
Does not provide the same level of isolation request-to-request, as a process-based MPM does.
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!
Reply With Quote
Sponsored Links
  #2  
Old 22nd February 2011, 17:45
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,384 Times in 4,231 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 22nd February 2011, 17:53
talkingnews talkingnews is offline
Member
 
Join Date: Jan 2011
Posts: 65
Thanks: 15
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by till View Post
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.
Hmm, but this, I don't understand. All the mail features are turned off, and I saw this post:

Quote:
> I'm running Apache 2.2.9 on a machine with 4G of RAM, and the server
> experiences about 100,000 hits a day, ~1G bandwidth and about 30,000
> page requests.

That's about 100 times more memory than you should need for the load
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?
Reply With Quote
  #4  
Old 22nd February 2011, 18:07
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,384 Times in 4,231 Posts
Default

Quote:
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?
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.

Quote:
So are you saying that swapping to worker, which the other guide says uses less RAM, would not help me then?
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
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
talkingnews (22nd February 2011)
  #5  
Old 22nd February 2011, 18:13
talkingnews talkingnews is offline
Member
 
Join Date: Jan 2011
Posts: 65
Thanks: 15
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by till View Post
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
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?
Reply With Quote
  #6  
Old 23rd February 2011, 15:04
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,384 Times in 4,231 Posts
 
Default

Quote:
Or does the overall memory usage not work like that?
Yes, it does not work like that. As I explained above, you can not calculate the ram amount in that way.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
apache 2, tuning, worker mpm

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
stalled: step 15 "the perfect server" expunkermikey Server Operation 5 29th April 2012 13:06
Mail server configuration with "The Perfect Server" for Ubuntu 10.10 SacreBleu Installation/Configuration 16 30th January 2011 01:21
Howtoforge the perfect Server(links) rini90 Installation/Configuration 0 14th December 2008 10:58
A few "The Perfect Server" Ubuntu style - questions theRick HOWTO-Related Questions 1 27th October 2008 12:23
Ubuntu "the perfect setup with RAID 1" Hans Installation/Configuration 1 16th January 2006 17:50


All times are GMT +2. The time now is 16:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.