According to the documentation there is a 6 second limit on SetAsync using the same key on a Experience wide basis regardless of the server. There is a (60 + numPlayers × 10) per minute limit for SetAsync per server.
There is a shared key in a datastore I’m considering writing to on any server that’s running for my experience, however I have no way knowing if there is any budget left for that. GetRequestBudgetForRequestType does not allow you to specify a specific key to check. It only allows checking the SetAsync, GetAsync, etc… budgets per server.
So how do I know if there is budget left for an experience wide SetAsync call I want to do?
1 Like
The limit is per server is it not so I don’t think it would massively affect what your doing (if you are doing that many requests per server that its meeting the datastore limits then you may want to check how efficient your code is).
May I also recommend if your updating values on as shared key within different servers you use UpdateAsync()
as that is better to use rather then SetAsync()
when your doing something server wide.
Ya, i’m not really worried about the per server limit for SetAsync or UpdateAsync, plenty of room for that and I’m not running into issues per server.
It’s this one I’m concerned about:
I don’t have to do what I’m trying to do with shared key, it would have just made something a little smoother. I have a way to do it without a shared key. Anyways, that’s irrelevant just wondering if anyone knows a way to check datastore budgets on an experience wide basis and not a server basis.
Not sure if there is a way but you could always have it in a pcall function which I think should deal with the error (you may even be able to see the error type via the pcall function).
1 Like
I’ll give that a whirl and see what happens… Although I have a feeling I may have to make some sort of system which designates one server as the master server and that server does the writing to that datastore key.
Hey did you ever put something together, would love to know what you did. I am going to have to work with a lot of requests on the same key, and im thinking maybe i just need a backlog of data that has a loop of a pcall until its successful (with max attempts at something like 5, of course)
I just ended up doing what I needed to do without a shared key, so I didn’t end up running into the issue.
Best bet though if you truly need to use a shared key across different servers would be to check the budget for UpdateAsync or SetAsync and if all is well attempt to write to that key in a pcall.
Then as you say, if that fails try again later. I wouldn’t try in rapid succession though, some sort of delay in between each attempt.
How would I go about checking the budget?
Here:
Although it’s not per key, but at least it’s better than nothing.
1 Like