ASYNC flushes possible?

We have previously emptied our databases in Redis using “flushDB ASYNC”. Dragonfly does not accept parameters for flushDB. However, “flushALL ASYNC” is accepted.

The documentation does not mention this, however.

So my question is: Is there a way in Dragonfly to perform asynchronous flushes in order to slow down the deletion of keys and thus reduce the load on the DB?

Hey @bergfreund,

You’re right. At the moment, the ASYNC/SYNC option is accepted, but I don’t think they take effect. Accepting the option is for compatibility reasons.

Although I can check where (i.e., in the background or not) the operation actually happens.

Thanks!

Hey @bergfreund, I confirmed with the team that FLUSHALL and FLUSHDB are actually by default async. They cannot be sync at the moment, and accepting the option is for compatibility reasons.

Hi Joe,

thanks for your answer.

It would be good if you could include this in the documentation. It would also be helpful if not only flushAll accepted the parameter for compatibility reasons, but also flushDB. In our case, this was the reason why Dragonfly was not fully Redis compatible.

Thanks for the feedback. I’ll update the documentation to reflect this behavior. And I’m glad the current behavior can provide what you need at least.

Going back to your original post, I’d like to clarify one point: when using FLUSHALL or FLUSHDB in Redis, the ASYNC option doesn’t necessarily “slow down” the deletion. Just that the SYNC option handles the entire deletion in the Redis main thread, which essentially blocks all other incoming requests during that period.

You’re right, in this case, Dragonfly behaves differently, but I’d argue this is actually an improvement. As newer versions of Redis are also leaning towards using ASYNC as the default.