You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/24 08:22:00 UTC

[GitHub] [apisix] jagerzhang opened a new issue #6188: request help: keepalive_pool can not disable in upsteram

jagerzhang opened a new issue #6188:
URL: https://github.com/apache/apisix/issues/6188


   ### Issue description
   
   APISIX配置中默认开启了keepalive提高性能:
   ```
   upstream:
         keepalive: 320
         keepalive_requests: 1000
         keepalive_timeout: 60s
   ```
   
   开启后,想在特定的 upstream 中关闭keepalive, 比如尝试在upstream里面添加如下配置:
   ```
   "keepalive_pool": {
       "idle_timeout": 0,
       "requests": 1000,
       "size": 320
     }
   ```
   添加后,idle_timeout 会被过滤掉,最终还是用的配置里面的keepalive_timeout。
   
   **请问下,APISIX本身就是这样设计的么?有没有办法在全局开启keepalive的情况下关闭指定upstream的keepalive?**
   
   目前看只能反过来实现,全局关闭keepalive:
   ```
   upstream:
         keepalive: 320
         keepalive_requests: 1000
         keepalive_timeout: 0s  #  设置为0
   ```
   
   然后在需要开启的upstream中打开keepalive。
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): 2.11.0
   - OS (cmd: `uname -a`): docker-centos
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #6188:
URL: https://github.com/apache/apisix/issues/6188#issuecomment-1020751797


   > after a quick glance at the code, I think the `idle_timeout` should overriding the default `keepalive_timeout` in the upstream, here
   > 
   > https://github.com/apache/apisix/blob/f81788bdb06518ce1411e3ac624311c23cd56a4f/apisix/balancer.lua#L288
   > 
   > I'm not sure if setting `idle_timeou`t to 0 will have the same effect as close keepalive.
   > 
   > cc @spacewander
   
   Yes, idle_timeout to 0 is equal to `keepalive_timeout 0`.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6188:
URL: https://github.com/apache/apisix/issues/6188#issuecomment-1020120332


   after a quick glance at the code, I think the `idle_timeout` should overriding the default `keepalive_timeout` in the upstream, here https://github.com/apache/apisix/blob/f81788bdb06518ce1411e3ac624311c23cd56a4f/apisix/balancer.lua#L288
   
   I'm not sure if setting `idle_timeou`t to 0 will have the same effect as close keepalive.
   
   cc @spacewander 


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] jagerzhang commented on issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
jagerzhang commented on issue #6188:
URL: https://github.com/apache/apisix/issues/6188#issuecomment-1020719779


   > after a quick glance at the code, I think the `idle_timeout` should overriding the default `keepalive_timeout` in the upstream, here
   > 
   > https://github.com/apache/apisix/blob/f81788bdb06518ce1411e3ac624311c23cd56a4f/apisix/balancer.lua#L288
   > 
   > I'm not sure if setting `idle_timeou`t to 0 will have the same effect as close keepalive.
   > 
   > cc @spacewander
   
   明白了,是因为 dashboard 这里会将idle_timeout=0的值过滤掉,通过admin-api更新idle_timeout=0则可以生效。


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] jagerzhang commented on issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
jagerzhang commented on issue #6188:
URL: https://github.com/apache/apisix/issues/6188#issuecomment-1020719779


   > after a quick glance at the code, I think the `idle_timeout` should overriding the default `keepalive_timeout` in the upstream, here
   > 
   > https://github.com/apache/apisix/blob/f81788bdb06518ce1411e3ac624311c23cd56a4f/apisix/balancer.lua#L288
   > 
   > I'm not sure if setting `idle_timeou`t to 0 will have the same effect as close keepalive.
   > 
   > cc @spacewander
   
   明白了,是因为 dashboard 这里会将idle_timeout=0的值过滤掉,通过admin-api更新idle_timeout=0则可以生效。


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] jagerzhang edited a comment on issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
jagerzhang edited a comment on issue #6188:
URL: https://github.com/apache/apisix/issues/6188#issuecomment-1020719779


   > after a quick glance at the code, I think the `idle_timeout` should overriding the default `keepalive_timeout` in the upstream, here
   > 
   > https://github.com/apache/apisix/blob/f81788bdb06518ce1411e3ac624311c23cd56a4f/apisix/balancer.lua#L288
   > 
   > I'm not sure if setting `idle_timeou`t to 0 will have the same effect as close keepalive.
   > 
   > cc @spacewander
   
   明白了,是因为 dashboard 这里会将idle_timeout=0的值过滤掉,通过admin-api更新idle_timeout=0则可以生效。应该是dashboard这里的逻辑可能有点问题。


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] jagerzhang edited a comment on issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
jagerzhang edited a comment on issue #6188:
URL: https://github.com/apache/apisix/issues/6188#issuecomment-1020719779


   > after a quick glance at the code, I think the `idle_timeout` should overriding the default `keepalive_timeout` in the upstream, here
   > 
   > https://github.com/apache/apisix/blob/f81788bdb06518ce1411e3ac624311c23cd56a4f/apisix/balancer.lua#L288
   > 
   > I'm not sure if setting `idle_timeou`t to 0 will have the same effect as close keepalive.
   > 
   > cc @spacewander
   
   明白了,是因为 dashboard 这里会将idle_timeout=0的值过滤掉,通过admin-api更新idle_timeout=0则可以生效。应该是dashboard这里的逻辑可能有点问题。


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #6188:
URL: https://github.com/apache/apisix/issues/6188#issuecomment-1020751797


   > after a quick glance at the code, I think the `idle_timeout` should overriding the default `keepalive_timeout` in the upstream, here
   > 
   > https://github.com/apache/apisix/blob/f81788bdb06518ce1411e3ac624311c23cd56a4f/apisix/balancer.lua#L288
   > 
   > I'm not sure if setting `idle_timeou`t to 0 will have the same effect as close keepalive.
   > 
   > cc @spacewander
   
   Yes, idle_timeout to 0 is equal to `keepalive_timeout 0`.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] jagerzhang closed issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
jagerzhang closed issue #6188:
URL: https://github.com/apache/apisix/issues/6188


   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] jagerzhang closed issue #6188: request help: keepalive can not disable in upsteram

Posted by GitBox <gi...@apache.org>.
jagerzhang closed issue #6188:
URL: https://github.com/apache/apisix/issues/6188


   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org