jujiale opened a new issue, #7504:
URL: https://github.com/apache/apisix/issues/7504

   ### Description
   
   hello:
     I use apisix-dashboard to config one route, it could config Keepalive 
Pool, such as:(the following config is in etcd)
   
   `
   
         {
          "id": "414195977881125816",
          "create_time": 1656409641,
          "update_time": 1658299923,
          "uri": "/get",
          "name": "httpbin-test",
          "methods": ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", 
"OPTIONS", "CONNECT", "TRACE"],
          "upstream": {
                  "nodes": {
                          "httpbin.org:80": 1
                  },
                  "timeout": {
                          "connect": 6,
                          "send": 6,
                          "read": 6
                  },
                  "type": "roundrobin",
                  "scheme": "http",
                  "pass_host": "pass",
                  "keepalive_pool": {
                          "idle_timeout": 0,
                          "requests": 1000,
                          "size": 320
                  }
          },
          "status": 1
       }
   
   
   `
   
   when I set idle_time is 0, according to 
[https://github.com/apache/apisix-dashboard/issues/2294](url), the keepalive 
should be closed, and when I set idle_time is 60s, I think it should open keep 
alive pool,but what I find is in following source code:
   apisix/balancer.lua -> method:set_current_peer(server, ctx) 
[https://github.com/apache/apisix/blob/f5f402f4484dc09300860a1798e003410e1fb456/apisix/balancer.lua#L284](url)
   
   `
   
       function set_current_peer(server, ctx)
             local up_conf = ctx.upstream_conf
             local keepalive_pool = up_conf.keepalive_pool
   
             if enable_keepalive then
                 if not keepalive_pool then
                     if not default_keepalive_pool then
   
   `
   
   I find whatever I set idle_time is 0 or 60s, the above **enable_keepalive** 
is also null, so keep_alive is closed, the **enable_keepalive** is set in front 
of  balancer.lua
   
[https://github.com/apache/apisix/blob/f5f402f4484dc09300860a1798e003410e1fb456/apisix/balancer.lua#L20](url)
   
   `
   
       local balancer          = require("ngx.balancer")
       local enable_keepalive = balancer.enable_keepalive and is_http
   
   `
   
   so I want to know in what situation, the **enable_keepalive** cloud have 
value? because there is no way to config this property. and how can I close 
keep_alive in route, set idle_time is 0?
   
   ### Environment
   
   - APISIX version (run `apisix version`): v2.11
   - Operating system (run `uname -a`):linux 3.10.0-1160.36.2.el7.x86_64
   - OpenResty / Nginx version (run `openresty -V` or `nginx 
-V`):openresty/1.19.9.1
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to