码迷,mamicode.com
首页 > 其他好文 > 详细

nginx proxy_buffer_size 解决后端服务传输数据过多,其实是header过大的问题

时间:2017-12-24 20:18:06      阅读:376      评论:0      收藏:0      [点我收藏+]

标签:epo   问题   buffers   var   query   top   hiera   开发   bsp   

 

原创 2017年03月17日 17:46:57
 

nginx proxy_buffer_size 解决后端服务传输数据过多,其实是header过大的问题

这三个参数已设置就搞定了额

proxy_buffer_size 64k;
proxy_buffers   4 32k;
proxy_busy_buffers_size 64k;
  • 1
  • 2
  • 3

本着精益求精的精神我翻了官网
官网解释

总体来说我还是没懂。我把报错信息放出来,以后用得着。
开发说nginx502了,后端访问jesery没问题

不行
curl -i -v "test.lebi.letv.cn/report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190"
可以
curl -i -v "http://10.142.165.45:8080/report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190"

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

日志对比

返回502
"10.73.137.12","[17/Mar/2017:16:32:08 +0800]","HTTP/1.1","-","GET","/report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190","502","http://test.lebi.letv.cn/report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190","172","0.157","10.142.165.45:8080","-","curl/7.35.0","0.157","329","328"

正常了
"10.73.137.12","[17/Mar/2017:16:32:47 +0800]","HTTP/1.1","-","GET","/report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190","200","http://test.lebi.letv.cn/report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190","1342118","4.350","10.142.165.45:8080","-","curl/7.35.0","0.180","329","1346306"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

我测了下,返回的json数据大约1.3M,可能是返回值太大,超过了阈值,但是超过了哪个呢,比较纠结。

查看error日志得到upstream sent too big header while reading response header from upstream,说header太大了。好好学习下header

技术分享图片

2017/03/17 16:32:08 [error] 17441#0: *403548696 upstream sent too big header while reading response header from upstream, client: 10.73.137.12, server: test.lebi.letv.cn, request: "GET /report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190 HTTP/1.1", upstream: "http://10.142.165.45:8080/report/rest/saiku/api/query/7C53220D-A870-1FE3-9353-4A6F967F25CB/result/metadata/hierarchies/%5BDM_REC.DIM_LIVE_STATION%5D.%5BDM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME%5D/levels/DM_REC.DIM_LIVE_STATION.LIVE_STATION_NAME?result=false&_=1489736122190", host: "test.lebi.letv.cn"
  • 1
 

nginx proxy_buffer_size 解决后端服务传输数据过多,其实是header过大的问题

标签:epo   问题   buffers   var   query   top   hiera   开发   bsp   

原文地址:http://www.cnblogs.com/lcword/p/8098739.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!