Won't redis cleanup expired keys block?

assume that concurrency is very high, with 1 million keys being put into redis, at the same time per second and with the same expiration time

so redis cleans up 1 million keys at the same time, without blocking?

Mar.01,2021

redis has several deletion strategies: regular deletion: delete immediately after expiration; lazy deletion: do not delete actively but check whether it expires when you get it; regular deletion: check the expired key periodically. If you choose to delete regularly, there will be these problems, but the built-in strategy of the redis server is lazy deletion.
suggest taking a look at the book on redis Design and implementation

Menu