nginx Errno 32:具有某些请求的断管

时间:2017-08-03 21:19:59

标签: python docker nginx wsgi broken-pipe

我有一个NGINX / flask / Docker服务器使用: https://github.com/tiangolo/uwsgi-nginx-flask-docker 它适用于运行小的和不经常的请求。但是,如果我尝试一些大的请求,涉及从亚马逊s3每个下载~5mb的数据(比如说,10个一次)。我收到这个错误:

return charToLong;

我已经尝试向nginx / wsgi添加更多进程和线程。我的uwsgi.ini看起来像这样:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 659, in inner
    srv.serve_forever()
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 499, in serve_forever
    HTTPServer.serve_forever(self)
  File "/usr/local/lib/python2.7/SocketServer.py", line 233, in serve_forever
    self._handle_request_noblock()
  File "/usr/local/lib/python2.7/SocketServer.py", line 292, in _handle_request_noblock
    self.handle_error(request, client_address)
  File "/usr/local/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/local/lib/python2.7/SocketServer.py", line 318, in process_request
    self.finish_request(request, client_address)
  File "/usr/local/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python2.7/SocketServer.py", line 652, in __init__
    self.handle()
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 216, in handle
    rv = BaseHTTPRequestHandler.handle(self)
  File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 251, in handle_one_request
    return self.run_wsgi()
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
    execute(self.server.app)
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 184, in execute
    write(data)
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 165, in write
    self.wfile.write(data)
IOError: [Errno 32] Broken pipe

我的nginx.conf看起来像这样:

[uwsgi]
module = main
callable = application
processes = 8
threads = 2

有谁知道可能导致这种情况的原因?

0 个答案:

没有答案