当前位置:  开发笔记 > 编程语言 > 正文

如何配置我的uWsgi服务器以防止出现不可读的错误?

如何解决《如何配置我的uWsgi服务器以防止出现不可读的错误?》经验,为你挑选了0个好方法。

这就是问题:

  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/six.py", line 535, in next
    return type(self).__next__(self)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/http/multipartparser.py", line 344, in __next__
    output = next(self._producer)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/six.py", line 535, in next
    return type(self).__next__(self)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/http/multipartparser.py", line 406, in __next__
    data = self.flo.read(self.chunk_size)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/http/request.py", line 267, in read
    six.reraise(UnreadablePostError, UnreadablePostError(*e.args), sys.exc_info()[2])
  File "/app/.heroku/python/lib/python2.7/site-packages/django/http/request.py", line 265, in read
    return self._stream.read(*args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 59, in read
    result = self.buffer + self._read_limited(size - len(self.buffer))
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 47, in _read_limited
    result = self.stream.read(size)
UnreadablePostError: error during read(65536) on wsgi.input

我目前的配置如下:

[uwsgi]
http-socket = :$(PORT)
master = true
processes = 4
die-on-term = true
module = app.wsgi:application
memory-report = true
chunked-input-limit = 25000000
chunked-input-timeout = 300
socket-timeout = 300

Python:2.7 .x | uWsgi:2.0 .10

为了使问题更加具体,当我同步处理图像以及图像上传时,就会发生这种情况.我知道理想情况下我必须使用Celery,但由于业务需求,我无法做到这一点.因此需要以允许我接受大图像文件,处理它然后返回响应的方式配置超时.

任何关于这个问题的亮点都会非常有帮助.谢谢.

推荐阅读
臭小子
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有