openresty / openresty/lua-resty-redis
How to create a single redis connection
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 2k
- Forks
- 447
- Avg merge
- 2h 24m
- Merged PRs (30d)
- 3
Description
I have tried creating a connection with pool_size = 1 and backlog=10 but every concurrent request creating new connection.
For 5 concurrent request this is the output.
netstat | grep redis
tcp 0 0 app-server:15174 app-redis-:6375 ESTABLISHED
tcp 0 0 app-server:14600 app-redis-:6375 ESTABLISHED
tcp 1 0 app-server:2666 app-redis-:6375 CLOSE_WAIT
tcp 0 0 app-server:15156 app-redis-:6375 ESTABLISHED
tcp 0 0 app-server:15158 app-redis-:6375 ESTABLISHED
tcp 0 0 app-server:15170app-redis-:6375 ESTABLISHED
Ideally it should have created 1 connection and queued the rest 4. Right ? Is this a issue from my side?
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 by reproducing the five-concurrent-request case with pool_size=1 and backlog=10, then inspect how the Redis connection pool handles concurrent requests. Compare the netstat connection count with the expected single connection and queued requests; document whether the behavior is caused by configuration or a pooling defect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, redis
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100