views:

80

answers:

1

WSGI application


# coding: utf-8

import time

def application(environ, start_response):
    status = '200 OK'
    output = str(time.time())
    time.sleep(5)
    output += ' -> ' + str(time.time())

    response_headers = [('Content-type', 'text/html; charset=utf-8'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)

    return [output]

Apache VirtualHost



    ServerName localhost

    WSGIDaemonProcess main user=www-data group=www-data processes=1 threads=5
    WSGIScriptAlias / /var/www/main/main.wsgi

    
        WSGIProcessGroup main
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    

    ErrorLog /var/log/apache2/main_error_log
    CustomLog /var/log/apache2/main_log common

Сonnecting multiple clients, they are processed sequentially, there is no multithreading. Why?

+1  A: 

This is being dealt with on mod_wsgi mailing list. See:

http://groups.google.com/group/modwsgi/browse_frm/thread/b8aaab6bfc4cca6d

Graham Dumpleton