I made my own Pooling system for everything related to the DataStore Requests using GetRequestBudgetForRequestType() with the proper Enum and I still receive a lot of those Warning in my Logs " Number of Request exceeded limit Number of Requst Exceeded Limit. "
We should receive the Exact number of Request left based on the Limits we see in the Roblox Documentation
But Instead we receive a number that is way too high…
Here is how I’m using it
local SetIncrementAsync = DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.SetIncrementAsync)
while SetIncrementAsync < 20 do
wait(5)
SetIncrementAsync = DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.SetIncrementAsync)
end
I think you may need to provide a bit more information on how you are dispatching these requests; for example, what API are you using to actually set the data (SetAsync, UpdateAsync or IncrementAsync) and what keys are you setting the data to.
Roblox employs a “throughput throttle” that limits how much data you can set / retrieve from each datastore key each minute (this is documented too); it is possible that you are instead hitting this limit rather than the request limit. I personally can’t reproduce this issue myself using the example you’ve shown while using separate keys to store data.
Did you confirm this? It is worth noting that unused datastore requests “stack up” until they reach a cap. This means that if you don’t use datastore requests often, you will have an insane amount left in your quota because you are practically given multiple minutes of the request quota; not just a singular one.
From the looks of this, it appears as if you are incrementing a key that will be accessed by a lot of servers (assuming many servers are active), the throughput limit is likely a major factor here and could be what is causing this; remember that the throughput limit adds a minimum of 1kb to the quota per request (because it is always rounded upwards) so even just 4000 writes in a minute from any server is enough to overflow the limit.
This would likely be caused by you using an OrderedDatastore as those use the sorted budgets rather than the “normal budgets”. Also, I have finally been able to reproduce this issue on my end using any Datastore operation on a key while another operation is editing the key. Is this possibly what you are running into or am I encountering a different “issue”?
I’ve observed that it may be the best solution, updating the value very frequently causes some undocumented Datastore limit to fire and throw the request into the queue, this is still a bug (because that limit is certainly not listed in the documentation) but it’s a good solution for now until we get some clarification on this extra limit.
Okay so I made a Test in a New Game with that Script. I published the game and Tested on a Live Server.
Now that I’m using the budget for SetIncrementSortedAsync the number goes down each time I use IncrementAsync, but Why does the Budget have always a lot of Space left when it break???
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DataStoreService = game:GetService("DataStoreService")
local Store = DataStoreService:GetOrderedDataStore("TotalExist", "Test")
local Inc = 1
function SaveToStore(Key, Value)
local success, err = pcall(function()
return Store:IncrementAsync(Key, Value)
end)
if success then
print("Success Budget:", DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.SetIncrementSortedAsync), "Amount of Call:", Inc)
return true
else
print("Failed Budget:", DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.SetIncrementSortedAsync), "Amount of Call:", Inc)
return false
end
end
while true do
wait(0.1)
local success = SaveToStore("TestKey"..Inc, 1)
if not success then
wait(5)
end
Inc += 1
end
We’ve made some fixes, and the budgets for SetIncrementAsync and SetIncrementSortedAsync now accurately reflect the throttling for Increments in Standard and Ordered DataStores, respectively.
It’s been mentioned in this thread, but I also want to point out that these budgets are specifically for the per-server limits.
If you are incrementing the same key from many servers at the same time, you may be throttled without exhausting your budget in any particular server. (The throttling you were running into in the screenshots in this thread was not this type and was indeed a bug.)
Please let us know if you find any further issues here!