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're processed sequentially, there's no multithreading. Why?

This really is being worked with on mod_wsgi subscriber list. See:

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

Whilst not exactly a solution, I observed the serial behavior having a similar setup when testing on one browser with multiple tabs. ( i attempted chrome7 and ff4 )

Wondering whether it was the browser enforcing the serial-ness, I attempted exactly the same test out two separate browsers, also it certainly demonstrated the server to become acting multi-threaded.

My setup was:
mod_wsgi 3.3-1
python 3.1.2-2
apache 2.2.17-1
on archlinux x86_64
tests were run with mod_wsgi in embedded mode.

hope it will help.