-
Notifications
You must be signed in to change notification settings - Fork 194
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
"channels over capacity in group xxx" flood #181
Comments
Perhaps a good hotfix would be to tone down the logger from exception to warning. Is It logging the exception on every call to |
Yes, this was added in #172. You can adjust the settings for the
Yes, this too: is there an issue here? |
@tarikki it seems so, but I haven't set any |
The default capacity is 100 messages and the default message expiration time is 60 seconds. So if the the channel is never read within these capacity / time constraints, it will fill up. I made the PR to log the channels over capacity event because I ran into an issue of messages not being delivered in production and it was only after logging redis queue lengths that I realised this was the root cause. One reason why a channel might fill up is a client having spotty wifi and disconnecting but the connection is never properly closed. In this case the channel will remain in the group and eventually fill up if enough messages are pushed to the channel through One way to mitigate this is to have enough capacity and a short timeout. This config in django settings solved the issue for me:
Every channel has a capacity of 1500 and every message expires in 10 seconds if it's not read. If you only have a couple of users on your system then this will not even make a dent in redis' memory usage. Hindsight being 20/20, a log level of exception might be a bit harsh here. The only reason why it should be logged is if you start wondering why some messages are not delivered for this reason, you can find out by digging through the logs. @carltongibson: I could make a PR to drop the log level to |
Hi @tarikki. Yes Maybe a note in README re expiry would be worthwhile too. |
Opened PR #183 to lower log level. EDIT: @carltongibson Oh I missed your comment on the README. What did you have in mind? |
@tarikki maybe you can add the following to the readme (from you explanation)
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": REDIS_URL, # or where your redis server lives
"capacity": 1500, # default 100
"expiry": 10, # default 60
}
},
},
} |
Hi @dperetti ,
Thanks for your time. |
@jberends: good idea! I'll try to make a PR for that at some point, now unfortunately too busy IRL. |
Since 2.42, we're getting tons of "channels over capacity in group xxx" messages, even though we make little use of django channels (just a couple admin users).
Still haven't found out exactly why, but the fact is: throwing this message in every
RedisChannelLayer.group_send()
call can be extremely noisy.It would be nice to find a way to throttle this!
The text was updated successfully, but these errors were encountered: