Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Proxy to Redis Server connection pool #247

Closed
segment11 opened this issue Apr 18, 2024 · 5 comments
Closed

Support Proxy to Redis Server connection pool #247

segment11 opened this issue Apr 18, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@segment11
Copy link

Module: camellia-redis-proxy
Content: As redis client send to redis server in pipeline mode, performance is much better. Can camellia-redis-proxy just use few connection to redis-server, send commands in batch?

Can blocking commands use this shared connection?
Will latency decrease badly?

@segment11 segment11 added the enhancement New feature or request label Apr 18, 2024
@segment11
Copy link
Author

Refer:
pgbouncer

Lightweight connection pooler for PostgreSQL

@caojiajun
Copy link
Collaborator

explain in example

1、redis client send cmds [cmd1、cmd2、cmd3、cmd4、cmd5、cmd6] to proxy in pipeline
2、proxy will route to redis-server1 [cmd1、cmd3、cmd4] and redis-server2 [cmd2、cmd5、cmd6] in two connection in pipline in sharding logic( custom sharding or redis-cluster sharding)

@caojiajun
Copy link
Collaborator

1、non-blocking cmd will use the shared connection
2、blocking cmd will use the no-shared connection

@segment11
Copy link
Author

explain in example

1、redis client send cmds [cmd1、cmd2、cmd3、cmd4、cmd5、cmd6] to proxy in pipeline 2、proxy will route to redis-server1 [cmd1、cmd3、cmd4] and redis-server2 [cmd2、cmd5、cmd6] in two connection in pipline in sharding logic( custom sharding or redis-cluster sharding)

I've thought the first case,there ares 2 redis-clients (client A/client B send cmds to proxy (proxy A) not in pineline, client A send [cmd1、cmd2、cmd3], client B send [cmd4、cmd5、cmd6],can proxy A just send all thease commands [cmd1..cmd6] once in pineline to upstream redis-server A?

@caojiajun
Copy link
Collaborator

In earily version, proxy's logic is what you want, but it means proxy should use a queue to buffer cmds, and run in producter-consumer thread model, it will cause frequent context switching in the CPU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants