question

amazdeh avatar image
amazdeh asked

First game process on the machine starts very slowly (playfab game servers)

We are using PlayFab gameserver features with the t2 nano servers and unity based game servers. GameServer is very very lightweight with message rate of around 10-15 per minute and each server has only 2 players. FrameRate of the server is limited to 60 because it will go on the roof if we don't set it.

We have a specific issue on the first game process on each t2 instance. We easily run 4 processes per AWS instance and I guess we can even increase it to larger values. The issue is that when first process is created, the game client either would not be able to connect to it or the connection will take 10-15 seconds to happen.

We put servers in Japan to be far from both US and Europe to find latency related issues sooner rather than later.

Until yesterday we actually were having difficulty connecting to first processes on instances most of the times but after I i made our server startups more lightweight, now I can most of the times connect to it but too late.


My question is, What is exactly going on when first instance is getting started. Do you also launch your own monitoring software and other stuff lazily when the first process starts?
Can I know a bit more about it and can we improve the situation? How bigger servers behave when we go to prod in this regard?

I imagine we would get bigger servers and run more processes on them for prod if we find out that our game performs better and more efficiently on bigger servers when testing.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The process for a hosted game server starting is that we request a server from EC2, then once it's available, we load the server image, then copy your build zip onto it, then unzip the build files into a directory. Once the Game Manager shows that server host as "Running", we're done - anything we needed to start on the machine is running. The wait on EC2, the image load, and the zip copy (depends on the size of your zip) are the most time consuming parts, and we recommend that you set your minimum available instance slots (Min free slots) to account for the most number of games that should need to start in a 15 minute period, currently.

Once the server is running, when an instance is spun up on the machine, the only thing that's done is that your executable is started - there are no other processes that need to be started. As soon as the server info is returned from a Matchmake or StartGame call, the player should be able to connect to that instance.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amazdeh avatar image amazdeh commented ·

@Brendan so you've never seen what I describe? Do you have any idea why our servers behave like that?

0 Likes 0 ·
brendan avatar image brendan amazdeh commented ·

The only thing that would prevent players from being able to connect immediately would be if there was a blocking process in the custom game server code. Are you trying to load a large amount of data on start, for example?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.