Back to results for “Keyspace Notifications”
Redis › Keyspace Notifications

What performance considerations should you keep in mind when enabling keyspace notifications on a high throughput Redis instance?

Advanced

Answer

Enabling keyspace notifications adds a small amount of overhead to every single operation on keys matching the enabled notification types, since Redis must publish a message for each matching event, so on a very high throughput system, you should enable only the specific notification types you actually need rather than broadly enabling all possible events, minimizing unnecessary overhead.
-- Enable only the specific events actually needed
CONFIG SET notify-keyspace-events 'Ex' -- only expired events, not everything
Real-world example A high throughput application carefully enables keyspace notifications only for expired events specifically, avoiding the additional overhead that would come from broadly notifying on every single write operation across the entire dataset.

Common follow-ups: How do you measure the actual performance impact keyspace notifications are adding to your system?;What happens to performance if many notification types are enabled simultaneously?