Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by Niklas Gawell · Oct 26, 2020 at 10:12 AM · CloudScriptMatchmaking

GetQueueStatistics in CloudScripts seems limited not per user

We have added a cloudscript end point where we want to make decisions based on statistics for one of our matchmaking queues. We call this end point very seldom (once every few minutes per user). And as long as there is only one player using this we are fine, but when there are more than one we start being throttled. It seems the limit is imposed per queue, rather than per player. We could circumvent this by having the player get the statistics (that works without throttle) and post that the script, but that seems dumb.

I attach a screenshot here where you can see the pattern. It all succeeds until two players happens to use the end point within a minute, then it fails. The error message we see is attached below

          "apiError": {
            "code": 429,
            "status": "429",
            "error": "MatchmakingRateLimitExceeded",
            "errorCode": 2054,
            "errorMessage": "The rate of get queue statistics requests for title!C6A22 has exceeded the limit and is temporarily throttled.",
            "errorHash": null,
            "errorDetails": null
          }
gdgg1.png (104.3 kB)
Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Rick Chen · Oct 27, 2020 at 09:19 AM

There is a limit of Number of GetQueueStatistics API requests an entity can make per queue within a period of 1 minute. You can check it in [Game Manager]->[Your Title]->[Title Settings]->[Limit], the limit’s name is “Queue statistic gets per minute”. The limit is usually 1. The GetQueueStatistics API should be called by the server in your CloudScript, not by user. Therefore, no matter which user executes the CloudScript, the GetQueueStatistics API is called by the same server entity. And calling 2 GetQueueStatistics APIs in 1 minute produce the limit error.

It is not recommended to allow players to call GetQueueStatistics API via CloudScript.

Comment

People who like this

0 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Niklas Gawell · Oct 27, 2020 at 09:52 AM 0
Share

So it is not recommended to use queue statistics in cloud scripts? I do not understand that limitation, but I guess I can work around it.

avatar image Rick Chen ♦ Niklas Gawell · Oct 30, 2020 at 06:03 AM 0
Share

The GetQueueStatistics API returns the matchmaking statistics for a queue. And the statistics are refreshed once every 5 minutes. Although GetQueueStatistics is an entity API, it is designed for servers only. You could use it in CloudScript, and one way to work around is to cache the result when GetQueueStatistics API is successfully called, and when it is not successful, catch the error and use the cache, for example:

handlers.GetQueueStat = function(args,context){
try{
result = multiplayer.GetQueueStatistics({QueueName: args.QueueName});
title_data_result = server.SetTitleData({Key:"NumberOfPlayersMatching", Value:result.NumberOfPlayersMatching});
return result.NumberOfPlayersMatching;
}
catch(error){
result = server.GetTitleData({Keys:["NumberOfPlayersMatching"]});
return result.Data.NumberOfPlayersMatching;
}
}

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    Question about Matchmaking and some bits about CloudScript 1 Answer

    [VERY URGENT] Unity Matchmaking with Mirror cannot connect to server 2 Answers

    Use Statistics value of Player Entity for MatchMaking rule 1 Answer

    Unable to call ExecuteCloudScript from Thunderhead server 4 Answers

    How would I use match-making (preview) for my game ? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges