WSGI應用mod_wsgi + apache沒有多線程,爲什麼?
# 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]
阿帕奇虛擬主機
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多個客戶端,它們被順序地處理,沒有多線程。爲什麼?
apache包,具體是什麼? – 2010-07-27 07:33:18
提供圍繞WSGIProcessGroup的配置缺失位。我假設它缺失,否則爲什麼它縮進。另外,你使用的是什麼Apache MPM,並且當你不應該擁有MPM設置時,讓你擺弄它。 – 2010-07-27 09:34:01