openresty / openresty/lua-resty-core

keepalive not working in top of balancer_by_lua_block

Open
#284 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
853
Forks
286
Avg merge
35m
Merged PRs (30d)
1

Description

if balancer config like below, keepalive not working
upstream backend {
keepalive 10; # connection pool
server 0.0.0.1;
balancer_by_lua_block {
--logic
}
}
and must be changed order of directive keepalive like this:
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
--logic
}
keepalive 10; # connection pool
}
but in nginx configthe order of directive in block has no effect on behavior of nginx

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two upstream configurations shown in the issue, comparing connection reuse when keepalive appears before or after balancer_by_lua_block. Trace the balancer and keepalive handling in the relevant lua-nginx-module integration points; done means both directive orders provide the same keepalive behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.