How many times can I use UpdateAsync at the same time?

One thing Ive seen is that updating data at the same time with updateAsync. What I am doing I need to save all the players data in the server at the same time, so I am wondering how many time can I use updateAsync at a time?

If it takes a while ill have to go back to setAsync

4 Likes

Data stores have limits. It’s advised to be really below these limits, but atleast follow the limits:

Request Type Functions Requests per Minute
Get (limit is shared among all listed functions)? GetAsync() UpdateAsync() *? 60 + numPlayers × 10
Set (limit is shared among all listed functions) SetAsync() UpdateAsync() 60 + numPlayers × 10

Question mark on UpdateAsnyc for Get as it does Get data and Well not including in the docs Table, It does mention it takes from both read and write limit here… Wether that means Only the Read and Write, or also the Get Request included in that, idk

Request Type Limit
Read 25 MB per minute
Write 4 MB per minute

You Should be handling Errors, and Yielding a tad after each requests. Also make sure the Queue doesn’t fill up.

1 Like

So if a game had 15 players in it that means you can have 750 requests per minute? Is that what its saying? Im not the smartest but thats what it seems like

1 Like

No. Its a base of 60, and then + 10 per player…

So 15 players would be 210 max requests per minute. Again it’s advised to be below the limit and not near the limit at all

1 Like

Ok. Also how does the queue fill up? I never figured that out

1 Like

Often it’s when you call it a bunch in a short amount of time, or your near the limits. You’ll get warnings and errors when you fill up the queue. It’s why I like to Yield a tad after each request if possible.

Would doing it 15+ times for instance fill up the queue? Also thank you so much for answering my questions

I wouldn’t think so as long as you add a little Yield after the request. Like task.wait(0.5) or something. Just check your output for any warnings or errors about the Queue filling up etc. and if so, figure out a way to make sure your requests aren’t filling the queue

Ok cool. Ill try this out. Not sure how I will tell if the queue fills up cause I dont have15 people : (

You can look for any warnings or Errors about it in the Live error reporting in the Creator Dashboard. For testing make sure they don’t pop out in the output. If players report data loss or you see these errors / warnings about it in the Live Error reporting, then you’ll know it’s an issue

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.