openresty / openresty/lua-resty-redis

How to create a single redis connection

Open
#261 5 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.