zoukankan      html  css  js  c++  java
  • kong配置调整方式

    kong logs/error.log内确实发现大量日志

    2021/01/25 16:46:05 [warn] 166110#0: *3522559308 a client request body is buffered to a temporary file /usr/local/kong/client_body_temp/0000015840, client: , server: kong, 
    
    115.238.164.130 - - [25/Jan/2021:16:46:31 +0800] "POST " 502 157 "-" "python-requests/2.9.1"
    
    

    a client request body is buffered to a temporary file /usr/local/kong/client_body_temp/0000015840, client: , server: kong
    该报警要调整nginx 的client_body_buffer_size,默认为client_body_buffer_size 8k|16k;

    因为kong是在nginx上封装的,因此改kong的配置和nginx不完全一样

    按常规思路直接修改konga生成的nginx.conf是不生效的

    而kong reload后nginx.conf会被重置

    因为kong生成的nginx.conf文件主配置是在kong start时加载 /etc/kong/kong.conf 和一些信息,生成的,因此调整需更改

    /etc/kong/kong.conf 调大client_body_buffer_size

    client_body_buffer_size = 500k    # Defines the buffer size for reading the
                                     # request body. If the client request body is
                                     # larger than this value, the body will be
                                     # buffered to disk. Note that when the body is
                                     # buffered to disk Kong plugins that access or
                                     # manipulate the request body may not work, so
                                     # it is advisable to set this value as high as
                                     # possible (e.g., set it as high as
                                     # `client_max_body_size` to force request
                                     # bodies to be kept in memory). Do note that
                                     # high-concurrency environments will require
                                     # significant memory allocations to process
                                     # many concurrent large request bodies.
    

    测试 类似 nginx -t

    kong check
    configuration at /etc/kong/kong.conf is valid

    重新加载 类似 nginx -s reload

    kong reload

    如此 配置生效,问题解决

  • 相关阅读:
    内存溢出和内存泄漏的区别、产生原因以及解决方案
    HTTP1.0、HTTP1.1 和 HTTP2.0 的区别
    TCP, UDP, HTTP, HTTPS协议
    测试面试常见面试题汇总
    SDK测试方法
    App弱网测试工具--Qnet
    PerfDog性能狗移动端性能测试工具
    Jmeter作用域
    事务(转账功能)
    DBUtils
  • 原文地址:https://www.cnblogs.com/zihunqingxin/p/14459759.html
Copyright © 2011-2022 走看看