-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Too many Redis connections: ERR max number of clients reached on Heroku's free tier #104
Comments
@albertkim Hey Albert! Thanks for posting this. So sounds like it's Redis connections not database ones? |
@paveltiunov correct. |
So the solution is to create redis connection pool here or just reuse non-blocking redis connections. Total count of Redis connections is equal to count of waiting concurrent users + some constant connections count used to retrieve cache. Redis itself is capable of handling thousands of concurrent connections. For Heroku it's merely a pay wall. You can consider using Redis services without connection limit like https://www.compose.com/pricing#redis. If there's only single instance of Cube.js server then you can consider running Cube.js without Redis at all: https://cube.dev/docs/deployment#production-mode-running-without-redis |
* Pool redis connections * Drain pool after test completion * Increase pool size, decrease idle timeout * Install jest instead of mocha * Convert tests from mocha to jest * Fix resource leak in fallback mode * Fix matcher conversion Fixes #104
Getting this issue with the latest version. Looks like Redis polling has been merged, has it made it to live release yet? |
@0x62 Hey Ben! Yep. It's live. However by default there're 1000 max connections for backward compatibility. Please see: https://cube.dev/docs/deployment#production-mode-redis-pool |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when
I use Heroku for Cube.js deployments. If I make 3+ concurrent queries to the server, the app instance will crash with the error ERR max number of clients reached. Heroku's free tier allows for 20 connections at once.
Describe the solution you'd like
As mentioned by Pavel on the Cube.js Slack channel, a connection poll would probably solve this issue to prevent Cube from using more than is available.
Describe alternatives you've considered
The only alternative I can think of is to pay more for Heroku. I've had to go up to Premium 2 to not crash, but I'm worried about what happens when more users are generating reports at the same time.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: