So I made a money DataStore that worked great until now. Only thing is, now it returns some warnings in the output and sometimes does not save. The error is:
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.
I am very confused as this happens 6 times as the server starts. Any suggestions? Thanks!
This is caused by invoking a data store too often. Data stores have limits on how often you can get or update data. In general, it’s good practice to autosave a player’s data every 60 seconds. Then, save their data when they leave as well. In general you should be able to have a maximum of 6 uses of a data store, per minute, per player, before it’s throttled. Look here for a more in depth look on data stores’ limits and errors.
Weird, as this occurs when the server starts and no data is being written.
It’s important that you don’t spam DataStores, as it could cause errors like that. If you want to be able to better handle those errors, I suggest wrapping DataStore requests in a pcall
/xpcall
so you can have your code wait a bit, then try again.
The only way this warning appears is if you’re using a data store. You’d have to check your code for anywhere that it might be using a data store. Here’s an image explaining the limits of data stores.
Weird, the only instances where I use a DataStore as the server starts (which is when this happens) is by using DataStoreService:GetDataStore()
, there are no GetAsync
or SetAsync
requests as the server starts, so I’m not sure how this error is occurring without even attempting any GetAsync
or SetAsync
requests. Any suggestions?