I know this is an old thread, but it also shows the demand for the ability to run more than one game session on a single game server process since 2017, 3 years ago…
@Pip I think @Brett_Yeager is actually talking about running more than one game session on a single game server. But I get the point where “instance” is an EC2 box that can host up to 50 game server processes. With one-to-one mapping between the game server process and the game session, that means an EC2 instance can host up to 50 game sessions.
This is a serious tech limitation, which leads to a cost pitfall for certain genres, especially for Realtime Servers, which been advertised as a simple message relay server + light server-side scripts.
Let me break down the reasons, taking Realtime Servers with 1v1 gameplay as an example.
Realtime Servers is based on NodeJS, an event-driven application
With NodeJS, you can run hundreds/thousands of concurrent requests per second. Because network application is usually IO-bound. This is especially true for Realtime Servers, which is mostly a messaging relay server with some light server-side logic. Think about a mobile server with 1v1 real-time battle gameplay, each player sends 1 message per second. NodeJS can still handle hundreds of game sessions in just one process.
In a real-world example, back to 10 years ago, a 1v1 gameplay battle game I operated with a similar (and simple) messaging relay architecture hosting on an old AMD Opteron 6128 (Cores: 8, Threads: 8, Single thread rating: 447 cpubenchmark.net) 2.0Ghz 32G memory can handle 5K CCU. It means each CPU thread can handle 625 CCU, roughly 300+ game sessions.
To convert it into a modern cloud environment, for c5.large (the smallest server spec you can rent with GameLift) is a 1 CPU core, 2 threads (vCPU), 4G mem box that running on Intel Xeon Platinum 8124M @ 3.00GHz (Single thread rating: 2084 cpubenchmark.net), the single-thread performance is doubled and you may expect 600 game sessions/threads. Let’s just be conservative to half the number to 600 game sessions (1200 CCU) on c5.large.
With the restrictions of GameLift’s one game server process can only host one game session, and up to 50 server processes on an instance. That means c5.large can only handle 50 game sessions (100 CCU). A huge waste of resources, money, and the scalability of NodeJS.
The 50 game server processes per instance limitation could be memory-bound
NodeJS is running on V8. Some sources suggest a 64MB~256MB is a sufficient amount of RAM to run Node.js (refs).
With c5.large, 4G / 50 ~= 82MB, near to the lowest memory requirements. You need to be more careful about the actual number of game server processes you can run on a small instance. It could be fewer.
The 50 game server processes per instance limitation are not scalable with EC2 specs
Let’s say 50 is a reasonable number for c5.large. Now with c5.4xlarge, I should expect 4 times more game server processes, but you still have 50 there. Does it make sense? That pushes developers to make a decision to find a server spec that can just run up to 50 game server processes, get anything more powerful is a waste.
The 50 game server processes per instance limitation didn’t take different players-per-session into account.
With 50 game sessions/instance, 1v1 gameplay has 100 CCU, 2v2 gameplay has 200 CCU, 10v10 gameplay has 1000 CCU. I’m okay with 1000 CCU on a c5.large. But I shouldn’t purchase far more instances just because my gameplay requires fewer players per session.
players-per-session |
max CCU/instance |
target CCU |
instances required |
on-demand pricing* |
spot pricing* |
home-made pricing* |
2 |
100 |
1000 |
10 |
400 |
150 |
40 |
4 |
200 |
1000 |
5 |
200 |
75 |
40 |
10 |
500 |
1000 |
2 |
80 |
30 |
40 |
20 |
1000 |
1000 |
1 |
40 |
15 |
40 |
- on-demand pricing for c5.large is estimated as $40.
- spot pricing for c5.large is roughly estimated as $15.
- home-made pricing is based on c5.large on-demand pricing.
Can GameLift support multiple sessions per game server process?
It doable but certainly more complex to implement the feature because GameLift has to trust more your game server to correctly manage game sessions. Memory leaking can be a big issue as well. GameLift has to implement more complex schedule logic to restart your game server process to avoid memory leaking.
But on another hand, I’m not sure if we can do the homework ourselves. Even you can call multiple ProcessReady and successfully cheat GameLift to run multiple sessions per game server process, you may break the GameLift server schedule logic.
Conclusions
- GameLift is good if you have a 5v5 or 10v10 gameplay. The more players-per-session, the fewer impacts on you from the limitation.
- GameLift is okay for 1v1, 2v2 with complex game logic on the server-side, which you won’t expect a large CCU per instance.
- GameLift is questionable for 1v1, 2v2 with simple game logic on the server-side. Especially the Realtime Servers which advertised for the simple messaging games. It is less cost-effective (card battle and turn-based genres). It should be a strong selling point for using GameLift Realtime Servers though. IMO without the feature, the entire Realtime Servers idea is useless or at least value dropped.
It’s a feature request since 3 years ago. Will GameLift plan resources on this feature eventually? Or at least make it possible for developers to implement it themselves?
Feedbacks are welcome.