如何在Docker容器中configurationFlask应用程序来parsing大型的MessagePack对象?

发送非常大的POST到Flask应用程序时,我得到以下内容。

日志:

restful stderr | /usr/local/lib/python2.7/dist-packages/werkzeug/filesystem.py:63: BrokenFilesystemWarning: Detected a misconfigured UNIX filesystem: Will use UTF-8 as filesystem encoding instead of 'ANSI_X3.4-1968' BrokenFilesystemWarning) restful stderr | 172.19.0.5 - - [25/Apr/2017 00:05:40] "POST /ml/source/ HTTP/1.1" 500 - restful stderr | Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app response = self.make_response(self.handle_exception(e)) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/opt/fish/bizco/ml/restful.py", line 49, in index job = q.enqueue_call(func=process_request, args=(postObject,), result_ttl=5000, timeout=36000) File "/usr/local/lib/python2.7/dist-packages/rq/queue.py", line 216, in enqueue_call job = self.enqueue_job(job, at_front=at_front) File "/usr/local/lib/python2.7/dist-packages/rq/queue.py", line 282, in enqueue_job pipe.execute() File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 2641, in execute return execute(conn, stack, raise_on_error) File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 2495, in _execute_transaction connection.send_packed_command(all_cmds) File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 556, in send_packed_command (errno, errmsg)) ConnectionError: Error 104 while writing to socket. Connection reset by peer. 

路线代码:

 @app.route('/zebra/', methods=['GET', 'POST']) def index(): print "/zebra/ called:") if request.method == "POST": state = True if request.headers['Content-Type'] == 'application/x-msgpack': print 'Found MsgPack' postObject = msgpack.unpackb(request.data) else: print 'Content type not correct' state = False if state == True: json = jsonify(...) else: # return an error json = jsonify...) return json 

POST对象包含一个MessagePack编码的有效载荷,但它永远不会进入我的路由处理程序。 我看到处理程序块内没有日志语句。

这似乎只在有效载荷超过200MB时发生。 如何让烧瓶正确储存手柄?