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

Question about connection pooling under Apache mod_perl #38

Open
hightowe opened this issue Mar 4, 2021 · 1 comment
Open

Question about connection pooling under Apache mod_perl #38

hightowe opened this issue Mar 4, 2021 · 1 comment

Comments

@hightowe
Copy link

hightowe commented Mar 4, 2021

Hi -

This is not an issue, per-se, but rather a question... Conceptually, I think that we would like to connection pool with RedisDB under Apache2 mod_perl, akin to how we connection pool to our database servers with DBIx::Connector. Am I correct about that and, if so, what is the proper way to connection pool with RedisDB under mod_perl? Or, am I simply overthinking trying to connection pool to Redis...?

Thank you,

Lester

@trinitum
Copy link
Member

when you connect to say postgres, it makes sense to have multiple connections so you could run multiple queries in parallel. Every connection to postgres means that there's a dedicated process on the server side that handles exclusively that connection. With redis you have a single process on the server side handling all the connections, so generally it doesn't make sense to create multiple connections, with RedisDB you can issue multiple commands in parallel using a single connection and set callbacks that will be called upon receiving responses. If you fork, then RedisDB automatically establishes a new connection to the server. One case where you might want a pool of the connections is if you might have the same process working with multiple transactions at the same time.

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

No branches or pull requests

2 participants