stefanwille / crystal-redis

Full featured Redis client for Crystal
MIT License
380 stars 61 forks source link

crystal-redis leaks memory? #79

Closed saturn-network closed 5 years ago

saturn-network commented 5 years ago

Perhaps because of https://github.com/ysbaddaden/pool/issues/2

Symptoms: when using crystal-redis inside amber framework with pooledconnection to cache responses, heroku dynos run out of memory (I presume due to request buffer filling up) and no requests end up getting served, the get stuck on redis.get.

Does anybody have a success story using crystal-redis with amber framework or in production for web services in general?

stefanwille commented 5 years ago

Do you have repo that I can use to reproduce the issue?

kostya commented 5 years ago

there is no failed instances in pool, all connection reestablished when needed

saturn-network commented 5 years ago

@stefanwille unffortunately not at the moment. I shall do my best to come up with a minimal reproducible example and push that as a repo.

@kostya that may well be. Still, in practice what I have observed is that the instance grew its mem usage and died under load, and this only happens when we're using redis caching.

stefanwille commented 5 years ago

@saturn-network that minimal reproducible example would be very helpful

saturn-network commented 5 years ago

I can imagine :) Do you want to close the issue for now and have me reopen it when it's done, or do you want to keep it open?

stefanwille commented 5 years ago

Please leave this issue open for now.

saturn-network commented 5 years ago

Will open a new issue to track this with the writeup guiding through how the project is initialized, where redis comes into play, and we can discuss how to properly stress test the server and detect where the issues might be happening.

Perhaps the issue is with a specific amber version, or wrong usage of the language, or poorly configured GC