openresty / openresty/lua-resty-redis

Connection pool not creating

Open
#260 2 comments 0 reactions 0 assignees View on GitHub

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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.