As a new redis operation and maintenance engineer, i had no information about the lua scripts load in my redis. how do i know how many or the name of lua scripts loaded in redis cache?

Comment From: oranagra

From the client application's perspective you're not expected to know (scripts are designed to be the responsibility of the client application, and it should re-load them if missing).

From the host / admin's perspective, i don't think you care about the number of scripts and their names, you only case about the memory they use.

INFO MEMORY has these fields:

used_memory_lua
used_memory_scripts
number_of_cached_scripts

Comment From: oranagra

please let me know if that's insufficient, and in that case more info about what you aim to do.

Comment From: LeoDemoniac

Thanks your comment, I know this is the design of redis. But for me , I want to do a periodical inspection about the scripts, in order to prevent lots of write operations。

Comment From: LeoDemoniac

please let me know if that's insufficient, and in that case more info about what you aim to do. In other words , i want to know the content of the script.

Comment From: oranagra

you mean you want to know the actual code of the script? or just a list of script SHAs?

is it going to be used for hosting an unknown application? for debugging redis? or by the application itself?

Comment From: LeoDemoniac

Yeap, i want know the actual code of script, and the list of SHAs is also need by hosting the applications. This is just a question, not the real problem for me now!

Comment From: oranagra

The only reason i see for adding such a thing is in order to debug redis (so they'll be part of the DEBUG command, e.g. DEBUG SCRIPT LIST, DEBUG SCRIPT <sha>).

You should not have a need for a list of SHAs to host an application, the design is that the script code is part of the application code, not part of the host / server. if the application is considering this a dependency, then it's misusing redis.

I'm closing this issue for now. feel free to post or re-open if you have other information or use-case to consider.