AltraMayor / AltraMayor/gatekeeper

Upgrade to LuaJIT 2.1

Offen
#637 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
C
Sterne
1.6k
Forks
252
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.