SCRIPT-DEBUG(3valkey)

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

✨ 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