Hello everyone,
Recently as we are nearing some bigger testing and things, we have noticed one issue or well huge issue i would say how lua runtime works, so wanted to confirm here.
So we tried to stress test game which has machines:
2 vcpu, 4gb ram , nakama is only running on it, no prometheus or cockroachDB.
On that instance i was able only to create 50 matches ,and than memory spiked a hell a lot oO
Removing all modules from it, and having just stock match handler with state data as same as how it would be in normal match, i was able to create about 3500 matches and then memory got to 4gb.
Now the only difference is modules and importing. So my question is:
Since each match is an instance of Lua VM. does that mean if i have for example something like this:
- Match 1
-
- Improts network or requires network module which is on path (‘Network.handler’)
- Match 2
-
- Imports network or requires network module which is on path (‘Network.handler’)
Out expectations is that upon first importing which ever match was created first, second one uses cached one one and doesn’t import its, Thus memory is only paid once for first loading.
Can this be verified?
Or each import in match handler, is being “global” to that match handler Lua VM and not as server wide?
Thanks