使用uwsgi报以上错误,原因是上传文件是,文件稍大,首先上传时间长会引起timeout,然后上传文件需要保存到uwsgi的缓冲区,缓冲区超大小,解决方法是设置两个参数.
1.socket-timeout
上传文件时接收文件的超时时间,也就是说如果你设置socket-timeout为10s, 而10s到了文件还没有上传完,就会timeout的错.
socket-timeout
argument: required_argument
shortcut: -z
parser: uwsgi_opt_set_int
help: set internal sockets timeout
2.post-buffering
argument: required_argument
parser: uwsgi_opt_set_64bit
help: enable post buffering
参数解释:
enable http body buffering. uWSGI will save to disk all HTTP body bigger than the limit specified
post-buffering = 8192
will save to disk all the HTTP body bigger than 8K. This option is required for Rack applications as they require a rewindable input stream.
3.post-buffering-bufsize
argument: required_argument
parser: uwsgi_