Skip to content

Remove unnecessary Redis deletes for broadcast messages

Stan Hu requested to merge sh-optimize-broadcast-message-redis into master

!21038 (merged) removed an optimization that prevented a Redis DEL call from being issued if no broadcast messages were present. Now, two DEL calls are issued for every request, which led to a significant performance regression.

The Redis delete optimization was intended to prevent filtering stale messages over and over again. However, the optimization only worked when there were no other broadcast messages for the future. For example, if there were 1 current message and 1 message scheduled for 5 days later, the filtering would still need to be done.

To improve this optimization, we check to see whether the filtered set is different from the set we retrieved from the cache. If there is a difference, we know it's time to flush the cache.

This came out of an investigation in https://gitlab.com/gitlab-com/gl-infra/production/issues/1722.

Edited by Stan Hu

Merge request reports

Loading