channels over capacity in group xxx

Redis异常

"channels over capacity in group xxx"

环境:

  • Django:2.1.4
  • Python:3.7

原因:

频道默认设置的最大容量为100,到期时间为60秒。因此在这些容量/时间限制内从未读取过该通道,它被填满,抛出警告信息。

解决方法

django设置足够大的容量和较短的超时时间

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG": {
            "hosts": [(REDIS_HOST, REDIS_PORT)],
            'capacity': 1500,
            'expiry': 10,
        },
    },
}

https://github.com/django/channels_redis/issues/181

原文地址:https://www.cnblogs.com/jiumo/p/14582055.html