我正在尝试在nginx+uwsgi中使用django。它的表现非常好(比apache mod_wsgi更快),但是当我有超过100个并发连接时(例如:使用ab -n 100000 -c 150 http://localhost:8081/ 进行测试),我会在uwsgi日志中看到一些断开的管道:
nginx.conf:
user myuser;
worker_processes 8;
events {
worker_connections 30000;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream django {
ip_hash;
server unix:/home/myuser/tmp/uwsgi.sock;
}
server {
listen 8081;
server_name localhost;
location / {
uwsgi_pass django;
include uwsgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
uwsgi的启动方式如下:
/usr/local/bin/uwsgi -s /home/myuser/tmp/uwsgi.sock --pp /home/myuser/projects/django/est/nginx --module django_wsgi -L -l 500 -p 8
错误信息来自uwsgi:
writev(): Broken pipe [plugins/python/wsgi_headers.c line 206]
write(): Broken pipe [plugins/python/wsgi_subhandler.c line 235]
版本号是:nginx 的 1.0.6 和 uwsgi 的 0.9.9.2。
你知道如何解决这些错误信息吗?