openresty / openresty/lua-resty-redis
Connection pool not creating
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 2k
- Forks
- 447
- Avg merge
- 2h 24m
- Merged PRs (30d)
- 3
Description
`local red = redis:new()
red:set_timeout(10000)
local options_table = {}
options_table.pool_size = 1
options_table.backlog = 1
local ok, err = red:connect(redis_endpoint, redis_port, options_table)
ngx.say("reused times: ", red:get_reused_times())`
How to make sure that connection pool is created ???
For testing purpose kept the pool_size as 1, so that the same connection get reused.
But every time the red:get_reused_times() returns 0, that means new connection getting created everytime, instead of using the existing pool.
Is their any issue with the code ?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the shown redis:new(), set_timeout(), connect(), and get_reused_times() calls, then check the connection-pooling documentation and the relevant client entry points. Determine whether this usage should create and reuse a pool across requests, and document the required conditions or code changes that make reuse observable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, redis
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100