Testing DataStore limits problem

Hi, I am currently trying to test the limits of data store Set/GetAsync but every time I do it gives me an error saying

DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.

I know DataStore Set/GetAsync has a limit of 60 + (#Players * 10) but I still wanted to test it, so I created this while loop to do so

function PlayerAdded (Player)
	local Id	= 'Id-'.. Player.UserId
	local Count = 0
	
	local Data	= {
		Key = 'Value'
	}
	
	while task.wait() do
		local Success, Response = pcall(function()
			DataStore:SetAsync(Id, Data)
		end)
		
		if Success then
			Count += 1
		elseif Response then
			warn(Count)
		end
	end
	
end

It seems to be filling up without actually saving anything and halting my script in a pcall function. Could someone explain why this is happening??

Thank You!
~Tru :slight_smile:

1 Like

make the loop wait even more, set the wait to 1 second

Why would making it wait more prevent data store from filling up right away?

I’m just gonna bump this real quick cuz the Forums went 505 when I asked :sweat_smile:

you’re getting an error because you’re saving every miliseconds. You can only save every 60 seconds or 1 min, to not flood the requests.

1 Like

Why can I save more back to back if I delay it every couple seconds or so?

Because you’re alone, now imagine if multiple players are included.

Anyways everything you wanna know about datastore is here.
https://create.roblox.com/docs/scripting/data/data-stores

1 Like

mmmm, I found my answer, thank you so much!

2 Likes