[uwsgi-body-read] Error reading 65536 bytes. Content-Length: 560903 consumed: 0 left: 560903 message
来源:互联网 发布:免费身份证扫描软件 编辑:程序博客网 时间:2024/05/16 07:12
使用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_opt_set_64bit
help: set buffer size for read() in post buffering mode
参数解释:
set the internal buffer size during post buffering (this is the memory allocated to read chunks of the socket stream)
post-buffering-bufsize 65536
will allocate 64k as the buffer for socket recv(). For a 128k body two cycle/syscall will be used.
This is a very advanced option you will probably never need to touch
Refs:
1.http://simple-is-better.com/news/301
2.http://pythonic.zoomquiet.io/data/20110523113355/index.html
3.https://github.com/unbit/uwsgi/issues/363
- [uwsgi-body-read] Error reading 65536 bytes. Content-Length: 560903 consumed: 0 left: 560903 message
- [Fiddler] Error:Content-Length mismatch: Request Header indicated 16 bytes, but client sent 0 bytes.
- content-length bytes were read and there was no trailing null byte
- mvn install时Premature end of Content-Length delimited message body错误
- Warning: Unknown: POST Content-Length of 53 bytes exceeds the limit of 0 bytes in Unknown on line 0
- Error: Read from storage 0 bytes, but requested 12 bytes 的解决方法
- Reading given number of bytes with RSocket::Read()
- java.net.ProtocolException: Exceeded stated content-length of: '6144' bytes
- IllegalStateException: Content has been consumed
- Android:Content has been consumed
- IllegalStateException: Content has been consumed
- WARN Could not determine content-length of response body
- didn't meet stated Content-length,wrote:'133' bytes instead of stated '204' bytes
- nginx配置 error content length mismatch
- read(bytes)
- php - Fatal error: Unable to read X bytes in file.php on line 0
- android文件上传413 nginx [error] 9679#0: *318855 client intended to send too large body: 1593409 bytes
- ..java.lang.IllegalStateException: Content has been consumed..
- mysql 数据操作。唯一索引
- 自定义 View的常用方法
- Struts2+spring+Mybatis 简单配置
- Linux 安装配置 apache
- Project Euler:Problem 84 Monopoly odds
- [uwsgi-body-read] Error reading 65536 bytes. Content-Length: 560903 consumed: 0 left: 560903 message
- 总结POJ
- 二叉树转为有序列表
- Linux Shell编程学习笔记(4)
- Merge Two Sorted Lists
- 用Green定理解一道据说是小学六年级的平面几何数学题
- struts标签<logic:iterate>的用法
- Android工程架构的总结
- [LeetCode]Binary Tree Level Order Traversal II