DE-IBH / b3lb

BigBlueButton Load Balancer
https://b3lb.io
GNU Affero General Public License v3.0
15 stars 2 forks source link

Enable support for redis sentinal #103

Open killermoehre opened 1 year ago

killermoehre commented 1 year ago

redis sentinel is a fairly easy way to make redis high available.

django-cacheops has actual inbuilt support for this operation mode.

CACHEOPS_SENTINEL = {
    'locations': [('localhost', 26379)], # sentinel locations, required
    'service_name': 'mymaster',          # sentinel service name, required
    'socket_timeout': 0.1,               # connection timeout in seconds, optional
    'db': 0                              # redis database, default: 0
    ...                                  # everything else is passed to Sentinel()
}

Can this be implemented as well? Probably somewhere in /b3lb/loadbalancer/settings.py.

Or is a HA redis not necessary for b3lb?

liske commented 1 year ago

Using redis for cacheops increases the overall performance of b3lb (less db query overhead). b3lb won't fail if redis is unavailable if the setting CACHEOPS_DEGRADE_ON_FAILURE is set to true (default). It is encouraged to use a local redis instance on each b3lb node for resilience against a redis SPoFs.

Although having no functional impact the accessibility of redis might lead to severe performance issues in high load environments. It should be possible to add configuration support (parsing JSON from a env variable?) for CACHEOPS_SENTINEL.