You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by JW <jw...@centraltexasit.com> on 2002/07/04 09:32:16 UTC

Figuring out how much memory apache is using?

Sorry to ask such a lame Q, but I'm tired and my brain isn't working.

I'm trying to figure out how much memory, totaly, apache is using, and I'm
 confused abouit what's shared and what's not. See the following ps (right side
 snipped off):

jw@fluorite:/work/jw/2do > ps -auxwf|less
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
<snip>?
root     10369  0.0  0.0 56512   48 ?        S    Jun27   0:24
 /usr/sbin/httpd -f /etc/httpd/httpd.conf -D STATUS -D wwwrun   10370  0.0 
 0.6 23028 1704 ?        S    Jun27   0:00  \_ /usr/sbin/fcgi- -f
 /etc/httpd/httpd.conf -D STATU wwwrun   10371  0.0  6.1 120076 15700 ?     
 S    Jun27   0:37  \_ /usr/sbin/httpd -f /etc/httpd/httpd.conf -D STATU
 wwwrun   10372  0.0  5.7 101772 14588 ?      S    Jun27   0:31  \_
 /usr/sbin/httpd -f /etc/httpd/httpd.conf -D STATU wwwrun   10373  0.0  6.4
 116124 16436 ?      S    Jun27   0:42  \_ /usr/sbin/httpd -f
 /etc/httpd/httpd.conf -D STATU wwwrun   10421  0.0  5.7 106488 14620 ?     
 S    Jun27   0:33  \_ /usr/sbin/httpd -f /etc/httpd/httpd.conf -D STATU
 wwwrun   10425  0.0  5.9 112312 15180 ?      S    Jun27   0:35  \_
 /usr/sbin/httpd -f /etc/httpd/httpd.conf -D STATU wwwrun   10426  0.0  5.8
 118792 14984 ?      S    Jun27   0:39  \_ /usr/sbin/httpd -f
 /etc/httpd/httpd.conf -D STATU

So on average each child is using 6% of my 256 MB. That's 15MB PER CHILD.
 That seems HUGE. How are you supposed to calculate that?

I've had some people suggest that just one of those represents the whole
 apache usage. I don't think that can possibly be accurate. I've had others
 suggest that I do total_mem * 6% * number_of_children and I don't think
 that's right either.

*help* :-)

	JW

- --

- ----------------------------------------------------
Jonathan Wilson
System Administrator
Cedar Creek Software     http://www.cedarcreeksoftware.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Figuring out how much memory apache is using?

Posted by Pietro Cagnoni <pc...@mclink.net>.
Jean-Christian Imbeault wrote:
> Pietro Cagnoni wrote:
> 
>>
>> every single child needs 15M, but all the children share a part of it.
>>
>> the way to know how much exactly is shared depends on the operating 
>> system. ask for more help if you need.
> 
> 
> 
> 
> Could you elaborate on this, especially for Linux? Asumming that each 
> uses 15M and, for arguments sake, 5M is shared and 10M used by the child 
>  itself it would mean that on a 256M machine you should spawn more than 
> about 20 children or else you will start swapping out?
> 
> I must be missing something here :)
> 
> Jc

you're right, that's the way it works.

the workarounds i know are:

1) reduce the size of the executable, eliminating all the
modules you don't need;

2) disable keepalive; this way every child will be immediately
available for any request, instead of waiting for the next request
from the same client.

there may be smarter workarounds. let me know if you find any!
even the new threaded architecture of apache 2 could help,
but i didn't tried it yet.

pietro.










---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Figuring out how much memory apache is using?

Posted by Jean-Christian Imbeault <jc...@mega-bucks.co.jp>.
Pietro Cagnoni wrote:

> 
> every single child needs 15M, but all the children share a part of it.
> 
> the way to know how much exactly is shared depends on the operating 
> system. ask for more help if you need.



Could you elaborate on this, especially for Linux? Asumming that each 
uses 15M and, for arguments sake, 5M is shared and 10M used by the child 
  itself it would mean that on a 256M machine you should spawn more than 
about 20 children or else you will start swapping out?

I must be missing something here :)

Jc


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Figuring out how much memory apache is using?

Posted by Pietro Cagnoni <pc...@mclink.net>.
JW wrote:
> On Thursday 04 July 2002 03:40, Pietro Cagnoni wrote:
> 
>>JW wrote:
>>
>>every single child needs 15M, but all the children share a part of it.
>>
>>the way to know how much exactly is shared depends on the operating
>>system. ask for more help if you need.
>>
>>hope this helps.
>>
>>pietro.
> 
> 
> I would really like to know if at all possible.
> The example I gave in the previous message was from SuSE 8.0, running (suse's) kernel 2.4.18
> 
> 	JW

the easiest way i know is top, it should show a "shared" column.

pietro.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Figuring out how much memory apache is using?

Posted by JW <jw...@centraltexasit.com>.
On Thursday 04 July 2002 03:40, Pietro Cagnoni wrote:
> JW wrote:
>
> every single child needs 15M, but all the children share a part of it.
>
> the way to know how much exactly is shared depends on the operating
> system. ask for more help if you need.
>
> hope this helps.
>
> pietro.

I would really like to know if at all possible.
The example I gave in the previous message was from SuSE 8.0, running (suse's) kernel 2.4.18

	JW


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Figuring out how much memory apache is using?

Posted by Pietro Cagnoni <pc...@mclink.net>.
JW wrote:
> Sorry to ask such a lame Q, but I'm tired and my brain isn't working.
> 
> I'm trying to figure out how much memory, totaly, apache is using, and I'm
>  confused abouit what's shared and what's not. See the following ps (right side
>  snipped off):

[...]

> So on average each child is using 6% of my 256 MB. That's 15MB PER CHILD.
>  That seems HUGE. How are you supposed to calculate that?
> 
> I've had some people suggest that just one of those represents the whole
>  apache usage. I don't think that can possibly be accurate. I've had others
>  suggest that I do total_mem * 6% * number_of_children and I don't think
>  that's right either.
> 
> *help* :-)
> 
> 	JW

every single child needs 15M, but all the children share a part of it.

the way to know how much exactly is shared depends on the operating 
system. ask for more help if you need.

hope this helps.

pietro.









---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org