BunkerWeb and Redis

I had the following behavior when using BB 1.6.6 and Redis.

My environment is bb 1.6.6 and redis installed on debian 12 (no docker).
I config the bb to use the local redis server, and i encounter problem loggin inside bb via web, and after a while obtaining an error.

By rebooting the server i was able to login but the problem was still persisting.
I took a note about the number of keys inside redis, it was almost 13.6k

There were two main processes that were taken too much ram like 10GB or more and they were the followings:

  • python3.11 -m gunicorn --chdir /usr/share/bunkerweb/ui --logger-class utils.logger.UiLogger --config /usr/share/bunkerweb/ui/utils/gunicorn.conf.py
  • /usr/bin/redis-server 127.0.0.1:6397

The two processes obtain so much ram until the server reach its total ram usage, and kicking-in the Out Of Memory process of linux to kill one of them, primary the python process, to stay active and not go into saturation.

After a while i review some best practice for Redis on Features - BunkerWeb documentation and i apply on /etc/redis/redis.conf the following two statements:

maxmemory 4gb
maxmemory-policy allkeys-lru

In this case redis will use max 4GB (but this depends on your settings or total ram available on the server) and when it reaches the limit, it will delete the least used keys, and it will not cause crashes nor interrupt cluster/scheduler operations. Restart redis server and voilà.

image

Redis is using less memery and login to bb web is fast, and the number of the keys used in redis they were about half.

Happy to share this.:grinning_face: