1. prefork MPM is configured with.
2. MPM configuration is like the following, contained by 
conf/extra/httpd-mpm.conf
<IfModule mpm_prefork_module>
    StartServers          5       
    MinSpareServers       5       
    MaxSpareServers      10      
    MaxClients          150     
    MaxRequestsPerChild   9
</IfModule>

3. Apache configuration file httpd.conf:
ServerRoot "/home/joshuawang/software/apache"
Listen 10087
LoadModule wsgi_module modules/mod_wsgi.so
Include conf/extra/httpd-mpm.conf
    
NameVirtualHost *:10087  
WSGIDaemonProcess www.site1.com  processes=3 threads=3  display-name=%{GROUP}
<VirtualHost *:10087>
    WSGIScriptAlias /wsgi/script "/home/joshuawang/wsgi/script/"
    <Directory "/home/joshuawang/wsgi/script/">
        WSGIProcessGroup www.site1.com
        Allow from all
    </Directory>
</VirtualHost>

4. The following is the test script I am using, time_consumed.py
import time
def application(env, start):
    status ='200 OK'
    headers = [('Content-Type', 'text/plain')]
    write = start(status, headers)
    for i in xrange(10):
        write(str(i)+',')
        time.sleep(1)
    
    content = 'Time up, response finished.'

    return [content]
 
I start two requests from the browser(firefox3.5.1) to the test script 
time_consumed.py. The first request was handled immediately, and I saw the 
counting number generated by the script. But the second request was blocked 
until the first request was finished after 10 seconds. Is it something wrong 
with my configuration?


2009-07-21 



Joshua Wang
ex-GDNTer




发件人: Graham Dumpleton 
发送时间: 2009-07-21  11:53:32 
收件人: modwsgi 
抄送: 
主题: [modwsgi] Re: How mod_wsgi handle concurrent wsgi request? 
 
2009/7/21 yashhappy <[email protected]>:
> Hi Graham:
>
> For a busy server, it's very normal that hundreds of rquests are arrived at
> the same time. Supposed that all the requests targetting  to a same wsgi
> script, how mod_wsgi handle all the requests? I did some tests for this
> case. The result is all the requests were served one by one, no matter how
> many processes or threads the daemon processs group contains.
> That would be a serious bottleneck, if some of the wsgi scripts are very
> time-consumeing. Is there any way to dispatch the requests to different
> processes to handle it concurrently or how to  improve the situation?
Apache/mod_wsgi has no issues with concurrency. It sounds like your
configuration is wrong and requests weren't actually being delegated
to daemon process as expected, that or you have poor Apache MPM
configuration. Other possibility is that whatever performance testing
tool you used, you didn't use it properly and weren't actually
generating concurrent requests.
Please provide the following:
1. What MPM Apache is configured with? Worker or prefork MPM if on UNIX.

2. What the MPM settings are in Apache configuration? How many
processes/threads, started servers, maximum etc. This is different to
mod_wsgi daemon mode configuration.
3. The mod_wsgi configuration you are using to setup daemon mode, map
your application and delegate to daemon process group.
4. Details of testing tool you are using and the command line options
you are running it with.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to