So I changed this question up a small bit to further elaborate on my problem. Now, I've found that, by printing when my game's data loads and saves, my second GetAsync request turns into a "HTTP 429 (HTTP/1.1 429 ProvisionedThroughputExceeded)" error every once and a while, even if there are only 2 calls in the past minute. For example, this is the output when I ran a server in studio with 8 players: (I removed stuff like "Replication" and "New connection" cause they don't matter)

Player -1 added
Loads: 1
Loads: 2
Player -2 added
Loads: 3
Player -3 added
20:41:26.795 - HTTP 429 (HTTP/1.1 429 ProvisionedThroughputExceeded)
20:41:26.796 - Script 'ServerScriptService.Stats', Line 116
20:41:26.797 - Stack End
Loads: 4
20:41:30.214 - HTTP 429 (HTTP/1.1 429 ProvisionedThroughputExceeded)
20:41:30.215 - Script 'ServerScriptService.Stats', Line 116
20:41:30.216 - Stack End
Player -4 added
Loads: 5
Player -5 added
Player -6 added
Player -7 added
Loads: 6
Loads: 7
Loads: 8
Loads: 9
Loads: 10
Player -8 added
Loads: 11
Loads: 12
Loads: 13
Loads: 14

The code block where the error occurs is as follows:

local dss = game:GetService("DataStoreService")  -- Line 3
local pkmnfiles = dss:GetDataStore("Pokemon")  -- Line 4
local othrfiles = dss:GetDataStore("Others")  -- Line 5

local data = pkmnfiles:GetAsync(newPlayer.UserId.."_Pokemon")  -- Line 112
dsloads = dsloads + 1  -- Line 113
print("Loads: "..dsloads)  -- Line 114
wait()  -- Line 115
local others = othrfiles:GetAsync(newPlayer.UserId.."_Others")  -- Line 116
dsloads = dsloads + 1  -- Line 117
print("Loads: "..dsloads)  -- Line 118

Line 116 is where it continues to produce that strange error. I added the wait() on line 115 to see if they were colliding, but it didn't solve the issue. Any ideas on why this might occur? All help is appreciated!

6 comments

0

Why not just have a print statement in every function that saves something to data store? Or if you wanted a more manageable approach, you could store that information in a table each time, and hold a reference towards it to access the history.

0

I'm not sure if something like this exists or not, but you could keep a tally of this yourself (maybe by using a remote/bindable event to send call a counting function each time you send a request, or alternatively using the OnUpdate function of DataStores for particular keys you want to track)

0

Gonna try it out, I'll say what happens.

0

Edited the entire post with newly-gathered information.

0

make a table and use it to avoid this issue.

0

I'm not sure you understand what I mean... each player has two arrays filled with information, each one needing to be loaded separately. However, sometimes the second load doesn't work when I tested an 8 player server on studio. It should print up to "Loads: 16", but it went to Loads: 14 on the example I gave.