Open groovecoder opened 8 years ago
Maybe this is also related to the redis servers becoming inaccessible on heroku's end? I've received several emails from heroku saying the servers are non-responsive in the last couple weeks?
Looking into this. I'm tempted to say it's related to us using createQueue
inside a loop, but the Kue documentation says that createQueue
returns a singleton:
Note that unlike what the name createQueue suggests, it currently returns a singleton Queue instance. So you can configure and use only a single Queue object within your node.js process.
I'll keep digging...
Another possibility is that we need to do a graceful shutdown in situations when the connections would otherwise be left open, for example when the application crashes.
There's other work that's more important right now, so I'm going to hop off this for a while.
We may be able to fix this by adding the heroku-buildback-redis buildpack. It will create a stunnel proxy connection for the web and worker processes to connect to redis, which should effectively give them a connection pool ... ?
When I got back to my https://groovecord2.herokuapp.com instance, I got these ...
Seems like something in the code is leaving redis connections open.
I was able to fix my instance by killing some idle redis connections:
And (hopefully) preventing the problem from happening again by setting the timeout to 60 seconds:
But, it seems like something in the code should be closing these connections?