question

Zhi Kang Shao avatar image
Zhi Kang Shao asked

Issue with and question about running server hours

Good day,

We've been spending last month integrating and testing PlayFab's matchmaking into our game. For this, we had 10 servers up all time and thus expect the server running hours to be at around 7400 at the end of each month. Right now (July 9) we are over the limit of 7500 though, which we didn't expect.

Is the running server hours counter supposed to reset on the 1st day of the month? If so, I believe this didn't happen for us. Could you please reset the server hours for us and look into why it didn't automatically reset properly? Our title ID is ED9D.

On that note, is there documentation available on how short game sessions affect the measured server running hours? When an AWS instance is up for 10 minutes and then shuts down, is it counted as a full hour? When a game server shuts down after 10 minutes, does the AWS instance stay running for longer, waiting for matchmaking to start a new game server? I'd love to hear any information about this.

Thanks,

Zhi Kang

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 latter question is pretty important to understand, so to answer it first, EC server hours are billed in whole-hour increments, from the start of each hour after a server is started (https://aws.amazon.com/premiumsupport/knowledge-center/ec2-instance-hour-billing/). So having a max instances per host that's close to your min available instance slots, means that you'll be starting and stopping servers more frequently.

But to answer the first question, yes, the server hours were reset at the end of the previous month. It looks like the actual problem occurred on the 6th, with the number of server hours climbing rapidly. We're investigating to determine the specifics now. However, one thing I do notice is that you had the MaxGamesPerHost set to 1, and the MinFreeGameSlots set to 5 at the time. That would meant that for any active region, you were requiring 5 running server hosts with zero players (so, anytime a game session was started, a new server was forced to spin up). That wouldn't have been the specific cause of running all the way up to 7500 hours, but it would certainly cause you to spin short-lived servers, so I'd highly recommend avoiding that.

Before we change your server hours, can you confirm that you've done testing to determine the max number of instances that can run on a server? We'd like to get that set to something other than 1/1 for max/minimum before the change, so that you're not costing yourself more than you should be.

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

brendan avatar image brendan commented ·

Follow-up: We can see when the issue occurred, and it does look like it was a temporary issue that caused the numbers to artificially increase. We've dropped your used server hours down to 830 - I'd still recommend adjusting your max instances per host before re-starting any servers, though.

And to be clear, all billing uses the actual billing statements from AWS, so don't worry - the server hours billed will only be based on the actual EC2 costs.

0 Likes 0 ·
corpseeater avatar image corpseeater commented ·

Hello Brendan, great work, and thanks for the swift support. I work with Zhi Kang on the same title.

Could you elaborate what was the 'temporary issue'? Was it a mistake on our end so we can avoid it in the future?

0 Likes 0 ·
brendan avatar image brendan corpseeater commented ·

No worries - nothing you need to do. It was due to a server failure that resulted in the process that computes the used hours failing. Basically, a corner case which we now have monitoring in place to protect against, so you shouldn't see it again.

0 Likes 0 ·
Zhi Kang Shao avatar image Zhi Kang Shao brendan commented ·

Hi Brendan,

I'm relieved to hear that those costs turned out to not be real. As for the MaxGames/MinSlots settings, for the month of June we were having a large group of people play test in their own time, so the perhaps unnecessarily costful settings were actually intended and budgeted for. As you probably saw we tuned them down now. We have yet to determine what number of games can run on one server, but will do so in the near future. Thanks for being watchful.

I guess I should have formulated my second question better. I was wondering how PlayFab's layer manages EC servers for game hosting. Since I believe you ultimately decide when to shut the EC server down after the game server executable has closed itself, how long do you keep the EC server running to potentially start a new game server? Or perhaps the EC server is shut down immediately when the other EC servers can satisfy the MinFreeGameSlots setting?

0 Likes 0 ·
Show more comments
Zhi Kang Shao avatar image Zhi Kang Shao commented ·

Hi again Brendan,

Could you help us determine what number of instances we can run on a server? We have done some 10-man play tests in the past month and it would be ideal if the CPU usage of those sessions could be looked at to determine this. If that is possible, can you please look at the CPU usage during these archived games?

Title ID: ED9D

Archived games (lobby ID and time):

C35C90944F523B7B at 7/3/2017 9:27:33 AM

E19190F6D3EB4FD0 at 7/3/2017 10:01:30 AM

If you have any other advice on how to determine the best number of games per host, I would appreciate that immensely. Thanks!

0 Likes 0 ·
brendan avatar image brendan Zhi Kang Shao commented ·

Sorry, but I don't have any way to look at the CPU/memory usage of a custom game server session that ran in the past. You would need to instrument your build to make that information part of your logging, ideally. Alternately, you could run the session locally and monitor the performance, to get a feel for the resources it uses.

0 Likes 0 ·
Zhi Kang Shao avatar image Zhi Kang Shao brendan commented ·

Okay, I will go ahead with one of those options you mentioned. Thank you. :)

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.