GetRequestBudgetForRequestType() not working

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. "

Here is the Official Documentation of it : DataStoreService | Documentation - Roblox Creator Hub

Expected behavior

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
4 Likes

What is the part of the code where you send to DataStoreService?

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.

2 Likes

Thanks for the report! We’ll follow up when there’s any update on the issue.

2 Likes

I’m printing the Result of the Budget when I got the " To many Request " Error from Roblox DataStore

DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.SetIncrementAsync)
It return 660 when it should be 0 …

I Even printed all the Budget to be sure its not juste a Category mistake from Roblox

1 Like

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.

1 Like

I’m making those Test on my own in a test game where only 1 server is Active.

I’m also seeing that the " SetIncrementSortedAsync" Is the only Budget going down when I’m doing an " IncrementAsync "

After arounf 30 request, I bust the budget and none of the Type are close to 0.

1 Like

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

1 Like

I tried with UpdateAsync and that one seems to work as Expected.
So its only SetIncrementAsync and SetIncrementSortedAsync that are having a problem.

1 Like

Hey, Its been a While since I reported that Bug and its still there…
Any news from the Team to know if its been Track??

2 Likes

Thanks for flagging this!

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!

2 Likes

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