question

dsousa avatar image
dsousa asked

Requesting Multiplayer Server - Too Many Requests

Hi,

I have been experiencing the same issue mentioned in this post: https://community.playfab.com/questions/68327/requesting-mp-server-in-short-time.html?childToView=69117#comment-69117 I am creating a new post for this question since there hasn't been any follow-up on that, and it seems that my comment was missed.

When I call the RequestMultiplayerServer server API on the client, I occasionally get the same error mentioned in the other post. I tried using CloudScript (Legacy) to call it instead, but it still doesn't always work - it just returns an empty result sometimes, instead of the error.

I am currently using 10 Servers Per Machine, and I have this issue even when only 1 or 0 of those are active and the rest are standby. I worked around this temporarily by having a loop run RequestMultiplayerServer until it succeeds, since after a minute or so it will eventually work again, but this can sometimes be a very slow and intensive solution.

Do you know of any reason why this error would happen when I am certain that I have standby servers available?

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

Gosen Gao avatar image Gosen Gao commented ·

What is the Target standby of your server build?

0 Likes 0 ·
dsousa avatar image dsousa Gosen Gao commented ·

The Target Standby is set to 1, but the Current Standby is 10 due to using 10 Servers Per Machine.

0 Likes 0 ·
dsousa avatar image
dsousa answered

I managed to fix the issue by reducing the number of servers per machine. It seems like one VM couldn't handle running 10 servers at once, which was causing my requests to frequently timeout.

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.

Dimitris Gkanatsios avatar image Dimitris Gkanatsios commented ·

You can use the VM metrics feature as you are developing to see how much CPU/RAM your servers are consuming https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/vm-metrics

This might help you get a good number.

If you want something more advanced, check here: https://github.com/PlayFab/VmStartupScriptGallery

0 Likes 0 ·
Gosen Gao avatar image
Gosen Gao answered

The Regions page of the server build has some delay, so it may happen that it shows that there are free standby servers, but you get a too many requests error when you request a new server. Please check the error message to see if it is "MultiplayerServerTooManyRequests - NoHostsAvailableInRegion - No Hosts available in regions 'xxx,xxx', please retry.".

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.

dsousa avatar image dsousa commented ·

Yes, I am getting this error:

/MultiplayerServer/RequestMultiplayerServer: MultiplayerServerTooManyRequests - NoHostsAvailableInRegion - No Hosts available in regions 'EastUs', please retry.

Sometimes I am getting this error as well:

/MultiplayerServer/RequestMultiplayerServer: The request was canceled due to the configured HttpClient.Timeout of 15 seconds elapsing.

Sometimes it will work fine, but occasionally it will start consistently returning one of these errors - sometimes for several minutes straight. This happens even when I can see several standby servers available on the Servers page of the server build.

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image Dimitris-Ilias Gkanatsios dsousa commented ·

In case of multiple calls, the UI might take a while to update. You should make sure to have an adequate standingBy server number to avoid 429s. In sudden player bursts, features like dynamic standby can help https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/dynamic-standby

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.