Question from a developer:
Would it be possible to use an hourly scheduled task to read all players from a segment (around 10K), match them up, and do an update to player data for each?
It sounds like you would be running a scheduled task against a segment, and taking a couple of actions per player (one read, and one write), which is certainly within scope of a triggered Cloud Script handler, but the processing time is going to depend upon the total number of players you're trying to get through. So while this should work fine in a segment of 10K users, as you start to scale up the user base, that time is going to grow - to the point where it could take more than an hour, depending on your service tier.
Thank you Brendan,
So as long as there is only 1 Scheduled Task running at the same time, the Cloud Script won't timeout and can make infinite amount of internal getData updateData calls?
Also I was wondering how many memory can we allocate inside a Cloud Script?
I'm thinking in creating batches of users to keep the computation time small
No, what I was saying was that Cloud Script handlers triggered via PlayStream (including Tasks) are more limited in terms of total runtime, not less. You can find the limit for Cloud Scripts running from PlayStream triggers on the limits page for your title.
So you would realistically need to process players one at a time, not try to load all of your users at once.
I have a solution that reduces the http requests by 4, so instead of making 1 read and 1 write per player, I could store the elo in a statistic in order to retrive it with the GetPlayersInSegment() in my own server, match them by myself and then make 1 CloudScript call with the 2 player parameters, that will load their data, simulate the fight and store the result.
Does the normal api call request limit (15) apply to this behaviour?
2 People are following this question.