-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: add Lua GC flags #5194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Lua GC flags #5194
Conversation
src/core/interpreter.cc
Outdated
@@ -1109,6 +1203,16 @@ Interpreter* InterpreterManager::Get() { | |||
} | |||
|
|||
void InterpreterManager::Return(Interpreter* ir) { | |||
static const uint64_t max_memory_usage = absl::GetFlag(FLAGS_lua_mem_usage_force_gc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would imagine we would like to change these flags without restarting the process.
please add support to "CONFIG SET" as well.
src/server/main_service.cc
Outdated
@@ -821,6 +821,8 @@ void Service::Init(util::AcceptServer* acceptor, std::vector<facade::Listener*> | |||
|
|||
config_registry.RegisterMutable("pipeline_squash"); | |||
|
|||
config_registry.RegisterMutable("lua_mem_usage_force_gc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's won't cut it and you have not tested that it works.
you used static const uint64_t max_memory_usage = ...
so it will be initialised only once
I've added 2 flags:
I have done some tests with lua_mem_usage_force_gc, and it shows quite good results to my mind, and it works fast.
Regarding the luagc flag, I've tried to use different parameters, according to https://www.lua.org/manual/5.4/manual.html#2.5.1 , and the results were insignificant, but with aggressive parameters performance can be dropped significantly