SCRIPT-DEBUG(3valkey)
β¨ SCRIPT-DEBUG (from the Valkey Command Manual, bestie) β¨
π NAME
script-debug β turns the debug mode for server-side Lua scripts on and off. That's it, that's the whole job, and she does it flawlessly.
π SYNOPSIS
SCRIPT DEBUG <YES | SYNC | NO>
π¦ DESCRIPTION
okay so, this sets the debug mode for scripts you run after this, specifically the ones you run with valkey-eval(7) EVAL. And here's the tea: Valkey ships with a whole entire Lua debugger, codename LDB, and it makes writing complicated scripts so much easier. In debug mode, Valkey lowkey becomes a remote debugging server, and a client like valkey-cli(1) can then run scripts step by step, set breakpoints, peek at variables, and more. For the whole lore on LDB, go read the valkey-ldb(7) Valkey Lua debugger page. iykyk π
Important note, and I mean this with my whole chest: do not debug Lua scripts on your production Valkey server. Use a development server instead. Please. For me. π
LDB can be enabled in one of two modes: asynchronous or synchronous. Let's break it down:
- In asynchronous mode, the server creates a forked debugging session that does not block, and all changes to the data are rolled back once the session finishes. Which means, slay, you can restart debugging from the exact same initial state.
- The alternative, synchronous debug mode, blocks the server while the debugging session is active, and retains all changes to the data set once it ends. She's committed, fr fr.
Now the actual values, bestie:
YESβ Enable non-blocking asynchronous debugging of Lua scripts (changes are discarded). π«ΆSYNCβ Enable blocking synchronous debugging of Lua scripts (saves changes to data). π₯NOβ Disables scripts debug mode. π
Want more on EVAL scripts? Go check out valkey-eval-intro(7) Introduction to Eval Scripts. β¨
πΈ REPLY
valkey-protocol(7) Simple string reply: OK.
β COMPLEXITY
O(1) β constant time, no notes, iconic behavior.
π ACL CATEGORIES
@scripting @slow
π HISTORY
- Available since:
3.2.0
π 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-exists(3valkey), script-flush(3valkey), script-help(3valkey), script-kill(3valkey), script-load(3valkey), script-show(3valkey)
that's the whole page bestie, go debug something (on a dev server!!) π
Valkey 9.0.0 β dated 2025-10-21, and this was SCRIPT-DEBUG(3valkey), signing off πβ¨
π¦ 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