uWSGI TCP / IP主机:端口vs Unix套接字

我们正在运行Python WSGI服务器(uWSGI),并更改为套接字文件而不是tcp / ip localhost:port连接。

现在我们的uwsgi日志充满了像这样的错误

IOError: write error SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) during GET /en/photos/?orientation... (ip ...) !!! uwsgi_response_write_headers_do(): Broken pipe [core/writer.c line 296] during GET /en/photos/?orientation... (ip ...) 

改回本地主机:端口,日志中没有错误。 页面正在加载两种configuration。

我们更喜欢Unix套接字,因为它们速度更快一些…有没有人知道是什么原因导致了这个错误?

uwsgi.ini:

 daemonize = /var/log/uwsgi/debug.log module = project.wsgi:application socket=127.0.0.1:1111 #socket = /tmp/tmp.sock #chmod-socket = 666 master = true vacuum = true chdir=/var/www/... pidfile=/tmp/project-master.pid enable-threads = true disable-logging = true processes=6 

nginx.conf

 location / { uwsgi_read_timeout 300; include uwsgi_params; uwsgi_pass 127.0.0.1:1111; #uwsgi_pass unix:/tmp/tmp.sock; } 

我也遇到了这个问题。 我的uwsgi日志错误就像你,同时我发现有我的nginx错误日志中的警报日志,如:“2017/05/16 18:09:33 [alert] 16405#0:1024 worker_connections是不够的”

所以我在nginx的conf文件中增加了worker_connections值。