recv() failed (104: Connection reset by peer) while reading response header from upstream
2013-03-13 16:58
232 查看
NGIN + UWSGI,get请求头过大,报502 Bad Gateway
如下,较大的get请求:
http://192.168.1.200:10000/planner/query?getdata=1&query=%7B%22activeDayspan%22%3A%227%22%2C%22condition%22%3A%22%22%2C%22hitLimits%22%3A%22%22%2C%22groupby%22%3A%5B%5B%22wrappedInterests%22%2C400%2C%5B%5D%5D%2C%5B%22demographicGender%22%2C20%2C%5B%5D%5D%2C%5B%22demographicIncome%22%2C20%2C%5B%5D%5D%2C%5B%22demographicEducation%22%2C20%2C%5B%5D%5D%2C%5B%22umaAdsImpression%22%2C20%2C%5B%5D%5D%2C%5B%22umaCreativeImpression%22%2C20%2C%5B%5D%5D%2C%5B%22umaAdsClick%22%2C20%2C%5B%5D%5D%2C%5B%22umaCreativeClick%22%2C20%2C%5B%5D%5D%2C%5B%22dspCreativeImpression%22%2C20%2C%5B%5D%5D%2C%5B%22dspCreativeClick%22%2C20%2C%5B%5D%5D%2C%5B%22dspAdsImpression%22%2C10%2C%5B%5D%5D%2C%5B%22dspAdsClick%22%2C10%2C%5B%5D%5D%2C%5B%22viewthrough%22%2C20%2C%5B%5D%5D%2C%5B%22interests%22%2C10%2C%5B%5D%5D%2C%5B%22pid%22%2C20%2C%5B%5D%5D%2C%5B%22keyword%22%2C20%2C%5B%5D%5D%2C%5B%22companyVisited%22%2C10%2C%5B%5D%5D%2C%5B%22companyADViewed%22%2C20%2C%5B%5D%5D%2C%5B%22remarketing%22%2C20%2C%5B%5D%5D%2C%5B%22country%22%2C20%2C%5B%5D%5D%2C%5B%22province%22%2C50%2C%5B%5D%5D%2C%5B%22city%22%2C20%2C%5B%5D%5D%5D%7D&_=0.2326625478453934
NGINX中的error.log日志记录,表现为,类似:
recv() failed (104: Connection reset by peer) while reading response header from upstream
解决办法,在uwsgi中添加参数:
/usr/local/sbin/uwsgi -s 127.0.0.1:1182 -M -R 200 -p 4 --virtualenv="/usr/local/python-env/test-env" --env "DJANGO_SETTINGS_MODULE=settings" -w "django.core.handlers.wsgi:WSGIHandler()" --post-buffering32768
--buffer-size 32768
uwsgi 详细配置见:http://uwsgi-docs.readthedocs.org/en/latest/Options.html
如下,较大的get请求:
http://192.168.1.200:10000/planner/query?getdata=1&query=%7B%22activeDayspan%22%3A%227%22%2C%22condition%22%3A%22%22%2C%22hitLimits%22%3A%22%22%2C%22groupby%22%3A%5B%5B%22wrappedInterests%22%2C400%2C%5B%5D%5D%2C%5B%22demographicGender%22%2C20%2C%5B%5D%5D%2C%5B%22demographicIncome%22%2C20%2C%5B%5D%5D%2C%5B%22demographicEducation%22%2C20%2C%5B%5D%5D%2C%5B%22umaAdsImpression%22%2C20%2C%5B%5D%5D%2C%5B%22umaCreativeImpression%22%2C20%2C%5B%5D%5D%2C%5B%22umaAdsClick%22%2C20%2C%5B%5D%5D%2C%5B%22umaCreativeClick%22%2C20%2C%5B%5D%5D%2C%5B%22dspCreativeImpression%22%2C20%2C%5B%5D%5D%2C%5B%22dspCreativeClick%22%2C20%2C%5B%5D%5D%2C%5B%22dspAdsImpression%22%2C10%2C%5B%5D%5D%2C%5B%22dspAdsClick%22%2C10%2C%5B%5D%5D%2C%5B%22viewthrough%22%2C20%2C%5B%5D%5D%2C%5B%22interests%22%2C10%2C%5B%5D%5D%2C%5B%22pid%22%2C20%2C%5B%5D%5D%2C%5B%22keyword%22%2C20%2C%5B%5D%5D%2C%5B%22companyVisited%22%2C10%2C%5B%5D%5D%2C%5B%22companyADViewed%22%2C20%2C%5B%5D%5D%2C%5B%22remarketing%22%2C20%2C%5B%5D%5D%2C%5B%22country%22%2C20%2C%5B%5D%5D%2C%5B%22province%22%2C50%2C%5B%5D%5D%2C%5B%22city%22%2C20%2C%5B%5D%5D%5D%7D&_=0.2326625478453934
NGINX中的error.log日志记录,表现为,类似:
recv() failed (104: Connection reset by peer) while reading response header from upstream
解决办法,在uwsgi中添加参数:
/usr/local/sbin/uwsgi -s 127.0.0.1:1182 -M -R 200 -p 4 --virtualenv="/usr/local/python-env/test-env" --env "DJANGO_SETTINGS_MODULE=settings" -w "django.core.handlers.wsgi:WSGIHandler()" --post-buffering32768
--buffer-size 32768
uwsgi 详细配置见:http://uwsgi-docs.readthedocs.org/en/latest/Options.html
相关文章推荐
- 解决 recv() failed (104: Connection reset by peer) while reading response header from upstream
- recv() failed (104: Connection reset by peer) while reading response header from upstream
- recv() failed (104: Connection reset by peer) while reading response header from upstream
- php502问题解决:recv() failed (104: Connection reset by peer) while reading response header from upstream
- recv() failed (104: Connection reset by peer) while reading response header from upstream
- failed (104: Connection reset by peer) while reading response header from upstream, client: x.x.x.x
- nginx recv() failed (104: Connection reset by peer) while reading response header from upstream解决方法
- nginx 8051#0: *4 recv() failed (104: Connection reset by peer) while reading response header from u
- 对于PHP引起的(104: Connection reset by peer) while reading response header from upstream错误解决方法
- nginx [error] 15644#0: *112680 recv() failed (104: Connection reset by peer) while reading response
- nginx upstream timed out (110: Connection timed out) while reading response header from upstream
- nginx 502 日志 . recv() failed (104: Connection reset by peer)报错
- java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)我的解决办法
- 使用Mob短信验证出现 java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)异常
- Android网络请求报错:java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
- 迷糊的IOException:Java.NET.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
- java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
- *SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
- get value from agent failed: ZBX_TCP_READ() failed;[104] connection reset by peer
- Nginx" upstream prematurely closed connection while reading response header from upstream"问题排查