SCRIPT-FLUSH(3valkey)
β¨ 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 asynchronouslySYNC: 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
ASYNCandSYNCflushing 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
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms