Frequent Bugs Caused by Redis Caching

Hello,

I have identified that many recurring issues on the platform are caused by Redis caching. These caching problems significantly affect the stability and usability of the system.

For example:

  • The registration process sometimes stops working and shows a message indicating that there have been too many login attempts, asking users to try again later. This happens for all users at once.

  • When editing a course in the CMS — specifically when adding additional questions — the system does not display the correct number of questions in that section, instead showing an outdated count.

When I run the following command:

docker exec -it tutor_local-redis-1 redis-cli FLUSHALL

everything starts functioning normally again.

Is there a way to resolve this problem permanently without manually clearing the Redis cache every time? We have received numerous complaints from instructors regarding this issue, and it also compromises the integrity of the entire system.

Thank you in advance for your assistance.

@abylaikhan.suev.02 I’m not sure about the second issue but your first issue might not be redis specifically but infact the login ratelimiting not working well with your network setup. It tries to get the most likely end user IP it can, but depending on your network setup this may not be working as expected. Flushing redis is just dropping that count from the cache but you can also increase the LOGIN_AND_REGISTRATION_FORM_RATELIMIT and see if that helps the issue.

Good point, the login issues might be fixed by adjusting CLOSEST_CLIENT_IP_FROM_HEADERS: https://github.com/openedx/edx-django-utils/blob/ab59326910a768480eadcdba9ea38c513120f8ab/edx_django_utils/ip/internal/ip.py#L101

I tried increasing it to 300, but after a week the error appeared again. I don’t have that many registrations on the platform — I’d even say I get about 300 registrations in a week. Could the problem be that the cache isn’t being cleared every 5 minutes?