question

awright avatar image
awright asked

Multiplayer Server Stats Monitoring

Is there any supported way to obtain stats about the multiplayer server in a format that can be posted to e.g. datadog? I'm trying to figure out the best way to get simple stuff like CPU/RAM usage etc. for basic performance monitoring without doing something silly like shoving a datadog agent in the container and uploading a custom container.

Custom Game Serverssupport
1 comment
10 |1200

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

Sarah Zhang avatar image Sarah Zhang commented ·

We are looking for a possible solution.

0 Likes 0 ·
awright avatar image
awright answered

The playfab VM is a real VM that you can access. Since it is, I'm just going to have a custom process to discover VMs and install the Datadog agent container on them.

Process goes like this:

  • Get the list of builds, which has region configs in the list (MultiplayerServer/ListBuildSummaries)
  • Get the list of VMs for each (build, region) tuple (MultiplayerServer/ListVirtualMachineSummaries)
  • Call MultiplayerServer/CreateRemoteUser on each VM with a user/expiry which returns a password that can be used to SSH until expiry

And then install/configure the agent via SSH as per https://docs.datadoghq.com/agent/docker/?tab=standard

It's absolutely not a good way to do it and I _do not_ recommend it, but it technically works until I can find a better solution. At least the agent isn't part of the game server containers (of which there are multiple per box).

1 comment
10 |1200

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

Michael Coker avatar image Michael Coker commented ·

Ideally Playfab would provide a better solution (and a nice dashboard), but this looks like it would work. Thanks for sharing your findings.

0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered

If you want to monitor the usage rate of server‘s CPU and RAM. You can try to use PerformanceCounter in your server code, then send the logs to the remote endpoint on your own.If you need to check the states of active VMs, when the server session is in Active or Standby state, you can navigate to the [Game Manager]->[Multiplayer]->[Servers]->[Servers] to connect to the VM directly.

10 |1200

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

awright avatar image
awright answered

Yeah, no, that's absolutely not an acceptable way to do it. First, they're Linux containers so PerformanceCounter doesn't exist. Second, there are multiple containers per box (gameservers per VM), so there's no reason to have a bunch of overhead of each server trying to poll the box for stats. I've figured out an alternative way, I was just hoping there was some way that PF had already thought of. Thanks anyway!

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.

Sarah Zhang avatar image Sarah Zhang commented ·

Glad to hear that. Please feel free to let us know if you have any other technical questions about the uses of PlayFab.

0 Likes 0 ·
Michael Coker avatar image Michael Coker commented ·

I was also curious about this. What solution did you end up with?

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered
10 |1200

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

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.