question

Koya Tamura avatar image
Koya Tamura asked

How long are servers on VM alive?

How long are servers on VM alive?

I was testing how long servers on VM are alive.

What I did is:

- Game clients connect to the game server on PlayFab Multiplayer via WebSockets.

- Game clients heartbeat every 5 sec to the server.

Basically, the servers' code does not contain shutting down by itself.

The result of this test is, the server started on 2022-09-28T06:48:52.506551144Z and ended on 2022-09-28T08:45:27.10737166Z with no signal from PlayFab.

How long are servers on VM alive?

GameTitleID: B7F80

GSDK_output_133088211448299103.txt is here

2022-09-28T06:45:44.8308101Z    VM Agent Endpoint: 172.19.0.11:56001
2022-09-28T06:45:44.8309628Z Instance Id: 33a7cf11d5030057f34a65b6e9b970cb46afcf72dea230b304a26f5c8d76903c
multiplayer
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

·
Austin Brunkhorst avatar image
Austin Brunkhorst answered

Hi @Koya,

It looks like this VM became unhealthy due to heartbeats timing out and was unassigned around the timestamp you mentioned for the server ending.

I suspect this happened because you have a very large number of servers per VM configured. According to VM metrics, your host VM runs out of RAM as servers are allocated

I recommend lowering the number of servers per VM for your builds. You can use the VM metrics page to review memory availability (seen above) to find a good number based on the memory requirements of an individual game server. Alternatively, you can use a larger VM size which includes more RAM.


4 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.

Koya Tamura avatar image Koya Tamura commented ·

Thank you for your reply.

I checked another VM metric.

I wonder why Memory availability was gradually decreasing even though every server was standing by and servers never activated during this term.

0 Likes 0 ·
Koya Tamura avatar image Koya Tamura Koya Tamura commented ·

Does it indicate that my app has a memory leak?

0 Likes 0 ·
Austin Brunkhorst avatar image Austin Brunkhorst Koya Tamura commented ·

Have you tested for memory leaks in your game server? You could use something like Valgrind to do this. You could also try setting something like 5 servers per machine instead of 60 and observe if the memory availability continues to drop. In the past we've seen undefined behavior around resources when using very high servers per VM.

0 Likes 0 ·
Koya Tamura avatar image Koya Tamura Austin Brunkhorst commented ·

OK, I am going to try these two tests. Thanks!

1 Like 1 ·

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.