SCRIPT-FLUSH(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

✨ NAME ✨

script-flush β€” it literally wipes every single server-side Lua script out of the script cache. all of them. gone. bye bestie πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

SCRIPT FLUSH [ASYNC | SYNC]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, this one flushes the Lua scripts cache. like, the whole thing. ngl it's giving "spring cleaning but for your server" 🧹✨

By default, SCRIPT FLUSH will synchronously flush the cache. but here's the tea β€” if you set the lazyfree-lazy-user-flush configuration directive to β€œyes”, that changes the default flush mode to asynchronous. so the default is not always the default, iykyk 😭

You can also just say what you want out loud with one of these modifiers, and they'll dictate the flushing mode explicitly:

  • ASYNC: flushes the cache asynchronously
  • SYNC: flushes the cache synchronously

want the full lore on EVAL scripts? go read valkey-eval-intro(7) Introduction to Eval Scripts. it's a whole vibe πŸ“–


πŸ’Œ REPLY πŸ’Œ

valkey-protocol(7) Simple string reply: OK.

like. that's it. that's the reply. OK. iconic behaviour honestly πŸ‘‘


🌸 COMPLEXITY 🌸

O(N) with N being the number of scripts in cache

so yeah, the more scripts you hoarded, the longer this takes. no cap πŸ’€


πŸ”₯ ACL CATEGORIES πŸ”₯

@scripting @slow


⭐ HISTORY ⭐

  • Available since: 2.6.0
  • Changed in 6.2.0: Added the ASYNC and SYNC flushing mode modifiers.

🌈 SEE ALSO 🌈

eval(3valkey), evalsha(3valkey), evalsha_ro(3valkey), eval_ro(3valkey), fcall(3valkey), fcall_ro(3valkey), function(3valkey), function-delete(3valkey), function-dump(3valkey), function-flush(3valkey), function-help(3valkey), function-kill(3valkey), function-list(3valkey), function-load(3valkey), function-restore(3valkey), function-stats(3valkey), script(3valkey), script-debug(3valkey), script-exists(3valkey), script-help(3valkey), script-kill(3valkey), script-load(3valkey), script-show(3valkey)


okay that's the whole page bestie, go forth and flush responsibly 🫢

this was Valkey 9.0.0, dated 2025-10-21 β€” mwah, love u, bye πŸ’–

πŸ“¦ where this page comes from