You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Díaz Díaz <si...@hotmail.com> on 2007/08/18 18:46:19 UTC

[users@httpd] How to change from prefork to work MPM

Hi all,

I have a question, maybe silly question, about to how can I change the MPM 
on an Apache Installed, let me explain I have Apache 2.2.4 running on Fedora 
Core 5 with PHP 5 and Mysql 5; I've installed the apache with default 
options, "configure --enable-so",  I saw that default MPM installed was 
prefork, but now I want to changed it for worker MPM...

How can I do it?, I need recompile the apache "--with-mpm=worker"... I know 
this list it's for apache, what is the appropiate MPM Apache that works 
better with php?
regards

David

_________________________________________________________________
Acepta el reto MSN Premium: Correos más divertidos con fotos y textos 
increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis. 
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_correosmasdivertidos


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache consuming lot of memory

Posted by Joshua Slive <jo...@slive.ca>.
On 8/22/07, solidzh <so...@gmail.com> wrote:
> 2007/8/22, Joshua Slive <jo...@slive.ca>:
> > On 8/21/07, solidzh <so...@gmail.com> wrote:
> > > 2007/8/21, Joshua Slive <jo...@slive.ca>:
> > > > On 8/20/07, Jeff Peng <je...@gmx.net> wrote:
> > > >
> > > > >
> > > > > There is almost nothing reasons on those parameters setting,but it seems your application program itself is large.
> > > > > Also after install Apache,you could strip httpd to reduce some memory usage.
> > > >
> > > > I doubt that stripping the binary is going to do any good.
> > > >
> > >
> > > Why not? I once also striped the httpd,it reduce the size from 2M to 300K.
> > > If you're running 300 httpd,this really reduce some memory.
> >
> > That's just the size of the binary on disk. It normally won't have an
> > effect on actual memory usage. And even if it does have an effect, it
> > is in a part of memory that can be shared between all the processes.
> >
>
> Sorry but why it's shared by all the processes?From my
> understanding,all processes have their own memory area for storing
> codes.

A modern OS will minimize memory usage by sharing memory between
multiple instances of the same binary wherever possible.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache consuming lot of memory

Posted by solidzh <so...@gmail.com>.
2007/8/22, Joshua Slive <jo...@slive.ca>:
> On 8/21/07, solidzh <so...@gmail.com> wrote:
> > 2007/8/21, Joshua Slive <jo...@slive.ca>:
> > > On 8/20/07, Jeff Peng <je...@gmx.net> wrote:
> > >
> > > >
> > > > There is almost nothing reasons on those parameters setting,but it seems your application program itself is large.
> > > > Also after install Apache,you could strip httpd to reduce some memory usage.
> > >
> > > I doubt that stripping the binary is going to do any good.
> > >
> >
> > Why not? I once also striped the httpd,it reduce the size from 2M to 300K.
> > If you're running 300 httpd,this really reduce some memory.
>
> That's just the size of the binary on disk. It normally won't have an
> effect on actual memory usage. And even if it does have an effect, it
> is in a part of memory that can be shared between all the processes.
>

Sorry but why it's shared by all the processes?From my
understanding,all processes have their own memory area for storing
codes.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache consuming lot of memory

Posted by Joshua Slive <jo...@slive.ca>.
On 8/21/07, solidzh <so...@gmail.com> wrote:
> 2007/8/21, Joshua Slive <jo...@slive.ca>:
> > On 8/20/07, Jeff Peng <je...@gmx.net> wrote:
> >
> > >
> > > There is almost nothing reasons on those parameters setting,but it seems your application program itself is large.
> > > Also after install Apache,you could strip httpd to reduce some memory usage.
> >
> > I doubt that stripping the binary is going to do any good.
> >
>
> Why not? I once also striped the httpd,it reduce the size from 2M to 300K.
> If you're running 300 httpd,this really reduce some memory.

That's just the size of the binary on disk. It normally won't have an
effect on actual memory usage. And even if it does have an effect, it
is in a part of memory that can be shared between all the processes.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache consuming lot of memory

Posted by solidzh <so...@gmail.com>.
2007/8/21, Joshua Slive <jo...@slive.ca>:
> On 8/20/07, Jeff Peng <je...@gmx.net> wrote:
>
> >
> > There is almost nothing reasons on those parameters setting,but it seems your application program itself is large.
> > Also after install Apache,you could strip httpd to reduce some memory usage.
>
> I doubt that stripping the binary is going to do any good.
>

Why not? I once also striped the httpd,it reduce the size from 2M to 300K.
If you're running 300 httpd,this really reduce some memory.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache consuming lot of memory

Posted by Joshua Slive <jo...@slive.ca>.
On 8/20/07, Jeff Peng <je...@gmx.net> wrote:

>
> There is almost nothing reasons on those parameters setting,but it seems your application program itself is large.
> Also after install Apache,you could strip httpd to reduce some memory usage.

I doubt that stripping the binary is going to do any good.

But yes, it is almost certainly your php app that is allocating all
that memory. You should look there before looking at th apache config.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache consuming lot of memory

Posted by Jeff Peng <je...@gmx.net>.
-------- Original-Nachricht --------
> Datum: Mon, 20 Aug 2007 18:27:44 +0200
> Von: "David Díaz Díaz" <si...@hotmail.com>
> An: users@httpd.apache.org
> Betreff: [users@httpd] Apache consuming lot of memory

> Hi All,
> 
> I have running Apache 2.2.4 with PHP 5.2 and Mysql 5 on Fedora 5, my
> server 
> has 2GB RAM and only it runs a php runtime with flash embedded that stream
> MP3 files for 300 simultaneus users...
> 
> My point is that apache is consuming about 1.80GB!!!! I feel that it's not
> correct, my  prefork MPM config is...
> 
> <IfModule mpm_prefork_module>
>     StartServers            3
>     MinSpareServers       5
>     MaxSpareServers     10
>     MaxClients             300
>     MaxRequestsPerChild  10000
> </IfModule>
> 
> Other parameters are:
> 
> Timeout 30
> KeepAlive On
> MaxKeepAliveRequests 1000
> KeepAliveTimeout 3
> 
> Also the CPU load  is max 6% use..
> 
> I've been reading differents docs, What can I do to ensure that Apache
> just 
> consume the necesary memory?
> 


There is almost nothing reasons on those parameters setting,but it seems your application program itself is large.
Also after install Apache,you could strip httpd to reduce some memory usage.
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Apache consuming lot of memory

Posted by David Díaz Díaz <si...@hotmail.com>.
Hi All,

I have running Apache 2.2.4 with PHP 5.2 and Mysql 5 on Fedora 5, my server 
has 2GB RAM and only it runs a php runtime with flash embedded that stream 
MP3 files for 300 simultaneus users...

My point is that apache is consuming about 1.80GB!!!! I feel that it's not 
correct, my  prefork MPM config is...

<IfModule mpm_prefork_module>
    StartServers            3
    MinSpareServers       5
    MaxSpareServers     10
    MaxClients             300
    MaxRequestsPerChild  10000
</IfModule>

Other parameters are:

Timeout 30
KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 3

Also the CPU load  is max 6% use..

I've been reading differents docs, What can I do to ensure that Apache just 
consume the necesary memory?

thanks in advance....

David

_________________________________________________________________
Horóscopo, tarot, numerología... Escucha lo que te dicen los astros. 
http://astrocentro.msn.es/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to change from prefork to work MPM

Posted by Vincent Bray <no...@gmail.com>.
On 18/08/07, David Díaz Díaz <si...@hotmail.com> wrote:
> I have a question, maybe silly question, about to how can I change the MPM
> on an Apache Installed, let me explain I have Apache 2.2.4 running on Fedora
> Core 5 with PHP 5 and Mysql 5; I've installed the apache with default
> options, "configure --enable-so",  I saw that default MPM installed was
> prefork, but now I want to changed it for worker MPM...
>
> How can I do it?, I need recompile the apache "--with-mpm=worker"... I know
> this list it's for apache, what is the appropiate MPM Apache that works
> better with php?
> regards

Had you stuck with the RPM, you'd be able to just edit
/etc/sysconfig/httpd so switch to the /usr/sbin/httpd-worker server
binary.

However, I don't think running PHP with worker is terribly advisable
unless under controlled conditions. Aside from the oft-noted thread
safety issues in 'some' php extensions, there's also the potential
side effects of PHP crashing. There are multiple known methods for
causing mod_php to crash based on things like URL crafting. In prefork
that's not a really big deal as the parent will just spawn a new child
and carry on
but with worker you'll be taking out many requests at the same time.

This is all based on hearsay; I've never tried php and worker in
production, but they seem fine on my development box.

-- 
noodl