I want to be able to flush a database of its existing keys.
I am currently using flushdb, however when calling “flushdb” without the async flag, the query takes 10+ seconds to complete and hangs the redis instance, ie nothing else can connect/run at the time. Using the async flag the query completely seemingly instantly.
I understand the async command only deletes keys existing at the time of the function call, however it is unclear to me why not using async takes significantly longer to complete.
- Why does running flushdb in “sync” mode take so much longer than “async”?
- Why does this lock/hang the instance for this time?