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

Changed pool implementation to allow limiting the amount of connections #154

Merged
merged 2 commits into from Oct 10, 2015

Conversation

arjenw
Copy link

@arjenw arjenw commented Oct 6, 2015

The StackObjectPool allows for unlimited amount of connections in the pool. We experienced with that connection timeouts (most probably because the amount of sockets in the system became huge). Limiting the amount of RedisClients using the GenericObjectPool does fix that.

Also, usage of cloud Redis solutions sometimes have connection limitations, so in that case it is useful to be able to restrict the max amount of connections being allowed. It's anyway good to restrict resource usage as things are finite anyhow (and it's better to be in control of the limit then to let the system limit the resources as the latter might give unexpected exceptions).

The default limit is -1 (unlimited) for backwards compatibility reasons. If you feel that some limit is better, feel free to change.

I've enabled testing on Return (calls validateObject() on the factory), but disabled testing on borrow (as the write method in IO also takes care of that).

@debasishg
Copy link
Owner

Thanks for the PR. I will review it over the weekend and merge ..

debasishg added a commit that referenced this pull request Oct 10, 2015
Changed pool implementation to allow limiting the amount of connections
@debasishg debasishg merged commit e46f712 into debasishg:master Oct 10, 2015
@debasishg
Copy link
Owner

merged .. thanks ..

@arjenw
Copy link
Author

arjenw commented Oct 12, 2015

Welcome! Thanks for merging!

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

Successfully merging this pull request may close these issues.

None yet

2 participants