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

Redis backend too many open files #490

Open
mikelane opened this issue Jul 14, 2022 · 4 comments
Open

Redis backend too many open files #490

mikelane opened this issue Jul 14, 2022 · 4 comments

Comments

@mikelane
Copy link

Describe the problem

We have implemented django constance with a redis backend and a 60 local cache. When there is a large amount of traffic, our service becomes unstable, our latency spikes, and we get a ton of logs which say "too many open files." We have isolated the django-constance change as the only change we are deploying when we do this.

Could this issue possibly be related to this: https://stackoverflow.com/a/25283155/3858494?

Steps to reproduce

Enable django-constance with a Redis backend and a 60 second local cache. Subject the service to a heavy load.

System configuration

I don't want to reveal this in a public forum.

  • Django version:
  • Python version:
  • Django-Constance version:
@horpto
Copy link
Contributor

horpto commented Jul 23, 2022

Hi, do you use RedisBackend or CachedRedisBackend? Do you use something like gevent ? Which version of the python redis-py lib do you use? Also you can limit number of connections with he max_connections option

@mikelane
Copy link
Author

We used the CachingRedisBackend. We do not use gevent.

@horpto
Copy link
Contributor

horpto commented Jul 24, 2022

Well, great somebody except me uses caching. All calls to redis in CachingRedisBackend are occured under the lock so redis client should have only one connection. As constance object is singleton to all threads so something wrong maybe with redis-py client internals. What is current limit of connections of redis and how many redis clients (app node * app threads) is there?

@sergei-iurchenko
Copy link
Contributor

show your code please

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

No branches or pull requests

3 participants