Allocate Lua states on NUMA nodes that GT instances reside
mengxiang0811 opened this issue · 3 comments
In GT block, each GT instance needs to keep one Lua state to maintain the most recent Lua policies. Currently, the Lua states are allocated by calling luaL_newstate()
. However, this function doesn't allow us to create Lua states on a specific NUMA node, so it's possible that a GT instance and its corresponding Lua state are in different NUMA nodes, which may degrade the performance of Grantor servers. To improve the Grantor performance, we need to find ways to allocate Lua states on a specific NUMA node.
One can do this using lua_newstate()
instead of luaL_newstate()
. One find more information about lua_newstate()
in the second edition of the book "Programming in Lua", Chapter "31 Memory Management", Section "31.1 The Allocation Function".
The patch c5959c0 almost closes this issue, but it doesn't do so because the current version of DPDK that we are using does not include rte_realloc_socket()
.
Once we upgrade our DPDK version, one must replace rte_realloc()
with rte_realloc_socket()
in alloc_lua_mem_in_dpdk()
to close this issue.