mod_wsgi的+ APACHE不是多线程的,为什么呢? [英] mod_wsgi + apache not multithreaded, why?

查看:777
本文介绍了mod_wsgi的+ APACHE不是多线程的,为什么呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WSGI应用


# 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的虚拟主机

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多个客户端,它们被顺序地处理,没有多线程。为什么呢?

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

推荐答案

这是正在处理的mod_wsgi的邮件列表上。参见:

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

http://groups.google.com/group/modwsgi/browse_frm/线程/ b8aaab6bfc4cca6d

这篇关于mod_wsgi的+ APACHE不是多线程的,为什么呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆