AltraMayor / AltraMayor/gatekeeper

Upgrade to LuaJIT 2.1

Open
#637 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
1.6k
Forks
252
PR merge metrics
No merged PRs in 30d

Description

There are currently three motivations for upgrading LuaJIT from 2.0 to 2.1 in Gatekeeper:
1. [The 1GB memory limit **per process**.](https://stackoverflow.com/questions/35155444/why-is-luajits-memory-limited-to-1-2-gb-on-64-bit-platforms) Let $x$ be the amount of memory that a Lua state in an instance of the GT block consumes; this Lua state is responsible for running the Lua policy. A typical Grantor server has 2 instances of the GT Block. During Lua policy reloads, new Lua states are created in parallel to avoid hiccups while making policy decisions. Thus, $4x$ must be less than 1GiB, which implies that $x < 256MiB$; this is not much. Currently, Lua policies consume less than 1MB because most of its resources are allocated outside of Lua. LuaJIT 2.1 introduces the new garbage collector [GC64](https://blog.openresty.com/en/luajit-gc64-mode/), which lifts this limit to 128TB.
2. [There is no way to catch the "not enough memory" exception](https://www.freelists.org/post/luajit/Catch-PANIC-unprotected-error-in-call-to-Lua-API-not-enough-memory-event,1); also see the page [LuaJIT v2.0 Status](http://luajit.org/status.html). If this exception were catchable, GT instances could run the garbage collector and retry. This problem has been solved in LuaJIT 2.1.
3. Lua memory is not in huge pages or NUMA aware. Once GC64 is available, issue #143 can finally be implemented.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.