python - mod_wsgi + apache不是多线程的,为什么?

标签 python apache wsgi

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



    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

连接多个客户端,它们按顺序处理,没有多线程。为什么?

最佳答案

mod_wsgi 邮件列表正在处理此问题。请参阅:

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

关于python - mod_wsgi + apache不是多线程的,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3341514/

相关文章:

python - Django 在查看和下载时生成 csv 文件

python : send data of form to one email address

python - 如何在 Python IDLE Shell 中获取终端高度(以行为单位)?

python - 在一个 lambda 函数中转换两个 for 循环方法

python - Tornado 中的电子商务(非阻塞)VS Flask (WSGI)

python - Django 中带有代理的外部 API 请求

php - PHP 从什么顺序读取配置?

regex - 使用Perl正则表达式获取URI的第二个字符串

php - Apache 文件所有权/组

docker - docker 中的 Plotly dash 不加载 Assets