zoukankan      html  css  js  c++  java
  • nginx proxy_buffer_size 解决后端服务传输数据过多,其实是header过大的问题

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

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

    proxy_buffer_size 64k;
    proxy_buffers   4 32k;
    proxy_busy_buffers_size 64k;

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

    总体来说我还是没懂。我把报错信息放出来,以后用得着。
    开发说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"
    
    

    日志对比

    返回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"
    

    我测了下,返回的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"
  • 相关阅读:
    i18n在4种常见环境下使用的方式
    vue-style里面设置变量
    扫码登录功能如何实现?一文搞懂主流的扫码登录技术原理
    Gradle编译Spring源码
    Spring学习总结(7)-AOP
    Docker安装Redis
    Jvm相关文章
    上传项目到Github
    Win10系统安装MySQL Workbench 8
    [转]HashMap 和 currentHashMap 总结
  • 原文地址:https://www.cnblogs.com/jpfss/p/10242739.html
Copyright © 2011-2022 走看看