You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by John Hudak <jj...@gmail.com> on 2011/04/06 18:04:23 UTC
[users@httpd] Does this ps listing look correct when running Apache?
Under ubuntu 8.04 I installed, configured, and am running Apache 2.2.8).
When I so a ps -lax, I see the following:
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
4 0 6242 1 20 0 6928 2612 - Ss tty1 0:00
/bin/login --
4 1000 6248 6242 20 0 5572 2992 - S+ tty1 0:00 -bash
1 0 6285 6121 20 0 8084 876 - S ? 0:09
/usr/sbin/winbindd
1 0 6286 6121 20 0 8092 1296 - S ? 0:21
/usr/sbin/winbindd
5 10 8256 1 20 0 5352 1448 - Ss ? 0:00
/usr/sbin/faxq
1 10 8258 1 20 0 4688 1016 - Ss ? 0:00
/usr/sbin/hfaxd -i 4559
4 10 8266 1 20 0 5464 2412 - S ? 0:44
/usr/sbin/faxgetty ttyACM0
5 0 12714 1 20 0 23904 7080 - Ss ? 0:02
/usr/sbin/apache2 -k start
5 33 12716 12714 20 0 23904 4224 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 12717 12714 20 0 23904 4232 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 12731 12714 20 0 23904 4224 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 12733 12714 20 0 23904 4224 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 12734 12714 20 0 23904 4220 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 12735 12714 20 0 23904 4224 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 12737 12714 20 0 23904 4220 - S ? 0:00
/usr/sbin/apache2 -k start
5 0 12802 1 20 0 7600 2104 - Ssl ? 0:00
/usr/sbin/console-kit-daemon
5 33 13010 12714 20 0 23904 4224 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 13069 12714 20 0 23904 4224 - S ? 0:00
/usr/sbin/apache2 -k start
5 33 13467 12714 20 0 23904 4200 - S ? 0:00
/usr/sbin/apache2 -k start
1 1000 14289 1 20 0 2384 612 - Ss+ ttyS0 0:15
heyu_relay
---snip----
My question is: Why all the instantiations of apache2 -k start? I expected
to see one.
Doing some investigation I discovered that I have Apache built as
multi-process (pre-forked) so I am guessing that these are the suspended
processes?
If so, how many should there be? does this look right?
An ancillary question: the machine serves 4 name-based virtual sites, so
would it be better to have Apache built as multiprocess or mult-threaded?
The machine is a whopping 1.2 GHz, single core, with 1 GB of memory, and a
very large page size.
Thanks for the insight.
-John
Re: [users@httpd] Does this ps listing look correct when running
Apache?
Posted by Mark Montague <ma...@catseye.org>.
On April 6, 2011 12:04 , John Hudak <jj...@gmail.com> wrote:
> Under ubuntu 8.04 I installed, configured, and am running Apache 2.2.8).
>
> 5 33 13467 12714 20 0 23904 4200 - S ? 0:00
> /usr/sbin/apache2 -k start
>
> My question is: Why all the instantiations of apache2 -k start? I
> expected to see one.
Because you are using the preform MPM. See the documentation at
http://httpd.apache.org/docs/2.2/mod/prefork.html which says,
" A single control process is responsible for launching child processes
which listen for connections and serve them when they arrive. Apache
always tries to maintain several spare or idle server processes, which
stand ready to serve incoming requests. In this way, clients do not need
to wait for a new child processes to be forked before their requests can
be served."
> Doing some investigation I discovered that I have Apache built as
> multi-process (pre-forked) so I am guessing that these are the
> suspended processes?
They are not suspended, they are sleeping, waiting for incoming requests.
> If so, how many should there be? does this look right?
The number is controlled by the |StartServers
<http://httpd.apache.org/docs/2.2/mod/mpm_common.html#startservers>|,
|MinSpareServers
<http://httpd.apache.org/docs/2.2/mod/prefork.html#minspareservers>|,
and |MaxSpareServers
<http://httpd.apache.org/docs/2.2/mod/prefork.html#maxspareservers>|
directives in your Apache HTTP Server configuration file(s). See the
documentation at the URL above.
> An ancillary question: the machine serves 4 name-based virtual sites,
> so would it be better to have Apache built as multiprocess or
> mult-threaded?
It should not make a difference for most servers. If you have a large
number of requests, the worker MPM may be more resource-efficient.
However, not all third-party modules are thread safe, and hence may not
be usable with the worker MPM; I run the prefork MPM for this reason.
--
Mark Montague
mark@catseye.org