question

nico-1 avatar image
nico-1 asked

Asynchronous API calls, slows down all API calls

I just want to confirm if this is the case. when i make api calls at the same time, it seems to batch them all at once even if they are separate call requests. for example:

// pseudocode loop { playfabAPICall() }

output: call-1: took 5 seconds call-2: took 5 seconds call-N... took 5 seconds

comparison:

// pseudocode loop { playfabAPICall() wait 1.5 seconds }

output: call-1: took 0.2seconds call-2: took 0.2 seconds call-N... took 0.2 seconds

the elapsed time also seems to scale on how much ive looped it

apis
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

·
Xiao Zha avatar image
Xiao Zha answered

After testing, we found that API requests in the same batch may be processed together, so these API requests are affected by the API request that takes the longest to execute in the batch. Therefore, in order to reduce the execution time of each API, we do not recommend that you call multiple APIs at the same time.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.