question

cameronj avatar image
cameronj asked

Automatically "terminate" stale user-hosted servers,Automatically "terminate" user-hosted servers.

We're implementing matchmaking similar to Source Engine (Team Fortress, Counter-Strike).

Current workflow:

Dedicated Server

Client

  • Client calls GetCurrentGames, then filters out servers that have not sent a heartbeat within 5 minute

Using this paradigm I've noticed that servers don't appear to clean up after any length of time (and are still returned as valid servers using the GetCurrentGames API.) While I realize this may be intended behavior and that it wouldn't be a problem if all servers were being registered and de-registered cleanly, servers that are not shut down cleanly will still run into this problem.

In a production environment, how do you recommend cleaning up stale servers? I imagine it would be something along the lines of: use the Server API to query for all games once every hour/day(?) and deregister them (can a server be deregistered by something other than itself?.) It would be awfully neat, however, if this functionality were available from the web portal (maybe it does and I haven't found it yet?)

,

We're implementing matchmaking similar to Source Engine (Team Fortress, Counter-Strike).

Current workflow:

Dedicated Server

Client

  • Client calls GetCurrentGames, then filters out servers that have not sent a heartbeat within 5 minute

Using this paradigm I've noticed that servers don't appear to clean up after any length of time (and are still returned as valid servers using the GetCurrentGames API.) While I realize this may be intended behavior and that it wouldn't be a problem if all servers were being registered and de-registered cleanly, servers that are not shut down cleanly will still run into this problem.

In a production environment, how do you recommend cleaning up stale servers? I imagine it would be something along the lines of: use the Server API to query for all games once every hour/day(?) and deregister them (can a server be deregistered by something other than itself?.) It would be awfully neat, however, if this functionality were available from the web portal (maybe it does and I haven't found it yet?)

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.

cameronj avatar image cameronj commented ·

Well, that's odd. I wrote the post, clicked on the "Sign-in and post button", then accepted the prompt to copy my draft, but it duplicated everything after I posted :O

0 Likes 0 ·
brendan avatar image brendan cameronj commented ·

Thanks for the details. I've seen this happen to a few people, but wasn't sure how they were running into it, since I've never seen it myself. I'll open a bug with the AnswerHub team.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Actually, servers that haven't been heard from for 2 minutes are no longer returned from the matchmaker, and should no longer appear in the list you get from GetCurrentGames. Are you seeing something different?

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

cameronj avatar image cameronj commented ·

Here's an API call of GetCurrentGames I just made with all fields NULL: apiresults.txt

Currently, no servers are running, but 8 are showing (some from yesterday, one I just started recently and closed)

What's strange is that many of the older servers have identical last heartbeats.

0 Likes 0 ·
apiresults.txt (2.6 KiB)
brendan avatar image brendan cameronj commented ·

Interesting. Let me dig into this. Meanwhile, do any of them show up in the results if you call Matchmake?

0 Likes 0 ·
cameronj avatar image cameronj brendan commented ·

Matchmake culls out all the servers except the one I have running - success! I will switch over to that for the time being as we only have one game mode.

Conceivably, we should be able to get all game servers with multiple Matchmake calls, but I can see that getting a bit hairy with many game modes / regions if we intend to display a list of all available servers globally.

0 Likes 0 ·
Show more comments
antonmasnyi avatar image antonmasnyi commented ·

I have the same issue. Are there any plans to fix this?

0 Likes 0 ·
brendan avatar image brendan antonmasnyi commented ·

On what Title ID?

0 Likes 0 ·
antonmasnyi avatar image antonmasnyi brendan commented ·

4F42

0 Likes 0 ·
Show more comments
sriley avatar image sriley commented ·

i m also seeing old idle servers... title ID 9C9F

,

I'm also seeing old idle servers... title ID

9C9F

0 Likes 0 ·
brendan avatar image brendan sriley commented ·

I'm not seeing any at the moment - your Active Games page shows none running, and a call to GetCurrentGames shows no sessions. The only thing I'm seeing in the multiplayer section for your title is the one server you have configured as active in USEast: https://developer.playfab.com/en-us/9C9F/servers/builds.

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.