I´m using Ubuntu server 8.04, and i thought i´m using MPM because:
r...@julio33:/var/www/arp3# apache2 -V
Server version: Apache/2.2.8 (Ubuntu)
Server built: Jun 25 2008 13:51:29
Server's Module Magic Number: 20051115:11
Server loaded: APR 1.2.11, APR-Util 1.2.12
Compiled using: APR 1.2.11, APR-Util 1.2.12
Architecture: 64-bit
Server MPM: Worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/worker"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT=""
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
And i´m supposed you were right about there was one process with a lot
of child, not a lot of process sorry for my bad english, please take a
look on this image:
http://julio33.com/htop_wsgi.jpg
As a commentary only, this image is in another server, i´m not asking
for that :)
Also i noted that before i have some peaks when the application were
called
for first time, going up to 100% load, but know i don´t have them.
Thanks,
Julio
On 8 ene, 18:11, Graham Dumpleton <[email protected]> wrote:
> 2009/1/9 julio33 <[email protected]>:
>
>
>
> > II moved from prefork to MPM, and it´s incredible, everything is fast,
> > when in the past i made some test to the wsgi app with ab(from apache)
> > the four processor start working at 100%(on top) as long the test
> > works,
> > by now when i take the same test, the max load on any of the
> > processors
> > is 9%, also everything worked fine, the only thing i noted it´s that
> > now i
> > have like 25 process of apache, much more than before, however apache
> > only takes 40MB and after making some process only takes 55MB, before
> > after working was about 100MB and stays there until i restart it
>
> Huh, if you have moved from prefork to worker MPM, something isn't
> right if you have 25 processes running. That sounds like you are still
> running prefork.
>
> > I´m using the default mpm worker configuration:
> > <IfModule mpm_worker_module>
> > StartServers 2
> > MaxClients 150
> > MinSpareThreads 25
> > MaxSpareThreads 75
> > ThreadsPerChild 25
> > MaxRequestsPerChild 0
> > </IfModule>
>
> Which says, to start only 2 child worker processes initially, but if
> load picks up, allow up to a total of 6 child worker processes. When
> load drops off, Apache will start reaping process and should come back
> down to 2 or 3 processes.
>
> Thus, for default worker configuration, the most Apache processes you
> will see is 7. That is, the Apache parent process, and 6 child worker
> processes.
>
> What operating system (type/version) are you using? I could be going
> senile, but I recollect that monitoring tools in old Linux systems
> would show each thread within a process separately. So, you sure you
> aren't counting threads and not processes.
>
> > And i decided to not go to daemon mode, because i already have what
> > i want, however i will try that mode if you recommend me that.
>
> Whether you use daemon depends on how much memory your WSGI
> application uses. If running a fat application, you may be better of
> using daemon mode as then can restrict it to 1 fat process, rather
> than every Apache child worker process being fat. If the application
> is lightweight, then probably no harm in using embedded mode, but
> would still use more memory than needs to.
>
> Graham
>
> > Really thanks, you made a wonderful work with the mod_wsgi.
>
> > Best Regards,
> > Julio
>
> > On 7 ene, 23:16, Graham Dumpleton <[email protected]> wrote:
> >> 2009/1/8 julio33 <[email protected]>:
>
> >> > Hello, i will deactivate the PHP module, i was about to do that
> >> > yesterday, but
> >> > i forget that, i will disable today.
>
> >> > This is the apache2 -V command, it seems i use prefork:
>
> >> > r...@julio33:~# apache2 -V
> >> > Server version: Apache/2.2.8 (Ubuntu)
> >> > Server built: Jun 25 2008 13:54:43
> >> > Server's Module Magic Number: 20051115:11
> >> > Server loaded: APR 1.2.11, APR-Util 1.2.12
> >> > Compiled using: APR 1.2.11, APR-Util 1.2.12
> >> > Architecture: 64-bit
> >> > Server MPM: Prefork
> >> > threaded: no
> >> > forked: yes (variable process count)
> >> > Server compiled with....
> >> > -D APACHE_MPM_DIR="server/mpm/prefork"
> >> > -D APR_HAS_SENDFILE
> >> > -D APR_HAS_MMAP
> >> > -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
> >> > -D APR_USE_SYSVSEM_SERIALIZE
> >> > -D APR_USE_PTHREAD_SERIALIZE
> >> > -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
> >> > -D APR_HAS_OTHER_CHILD
> >> > -D AP_HAVE_RELIABLE_PIPED_LOGS
> >> > -D DYNAMIC_MODULE_LIMIT=128
> >> > -D HTTPD_ROOT=""
> >> > -D SUEXEC_BIN="/usr/lib/apache2/suexec"
> >> > -D DEFAULT_PIDLOG="/var/run/apache2.pid"
> >> > -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
> >> > -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
> >> > -D DEFAULT_ERRORLOG="logs/error_log"
> >> > -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
> >> > -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
>
> >> If you do not need PHP, then move to worker MPM. Doing that will also
> >> cut down memory usage as Apache will not create as many worker
> >> processes to handle requests.
>
> >> Then ensure you use mod_wsgi daemon mode. Use the defaults for
> >> WSGIDaemonProcess, which is 1 process with 15 threads. This is likely
> >> going to be more than enough for what you need.
>
> >> If you really want to try and cut down even further on memory, run a
> >> separate nginx web server for serving static files. Have that same
> >> nginx proxy the dynamic requests through to Apache/mod_wsgi and turn
> >> off keep alive in the Apache server. This configuration seems to be a
> >> favourite of people using VPS systems as it gives quite a low memory
> >> profile as well as other benefits.
>
> >> > If the python raise an error, the wsgi turns slower? or restart or
> >> > something?, by other side it´s bad using raise inside modwsgi?
>
> >> No. If the exception is not caught by the WSGI application, then all
> >> that will happen is that mod_wsgi will return a HTTP 500 error
> >> response indicating an internal server error and log to Apache error
> >> log the details of the Python exception that occurred. The process is
> >> kept running as there is no need to shut it down and restart when this
> >> occurs.
>
> >> BTW, you might find other discussion happening of interest:
>
> >> http://groups.google.com/group/modwsgi/browse_frm/thread/3a9c53dffd6b...
>
> >> Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---