3 ms·
I think maybe I've seen a similar issue and didn't know it? What's the right answer for that situation, node/express hitting redis which runs out of memory?
by jessaustin 7y ago
I think maybe I've seen a similar issue and didn't know it? What's the right answer for that situation, node/express hitting redis which runs out of memory?
- specialist 7y agoSorry for delay. Had to refresh my memory, dig up that old code. I used the 'queue' (submodule?) from caolan's terrific 'async' module to limit the number of Redis requests in flight. https://caolan.github.io/async/v3/docs.html#queue https://caolan.github.io/async/v3/docs.html#queue https://www.npmjs.com/package/async https://www.npmjs.com/package/async As said above, this prevents the Redis responses from piling up on the Redis server, waiting to be sent. To troubleshoot: If the Redis CLIENT LIST's output length list, output memory, or both, are growing without ever shrinking, then I'd bet one delicious apple fritter your app's Redis client isn't processing responses fast enough. Check out the 'obl', 'oll', 'omem' stats. https://redis.io/commands/client-list https://redis.io/commands/client-list -- Fronting Redis calls with async.queue makes the client code gnarly. So I banged out a (very minimal) client with an internal queue. I had been weighing releasing it. And then if there's any interest, then maybe flesh out the client. There's some other notions I had wanted to try out. I'm NOT a nodejs developer. So I hadn't fully worked out how to do proper I/O, with proper timeouts, retry, backoff. So for instance, I'd want the async.queue concurrency limit to be adaptive.
- jessaustin 7y agoThanks so much!