In the docs, it says that the limit for GET & POST requests is 500 per minute. However, after experimenting, I am seeing different limits in actual roblox game servers and in studio where roblox is running locally. I was not seeing it do this before. Why is this happening, and why does the documentation say that the limit is 500 requests that can be made out, when it really seems to depend on the environment it’s running?
local HttpService = game:GetService('HttpService')
local endpoint = 'http://google.com'
local runs = 2005
for i=1, runs do
spawn(function()
local response
local s,m = pcall(function()
response = HttpService:GetAsync(endpoint, true)
end)
if(not s) then
print('Error on iteration: ', i, m)
end
end)
end
When I publish this game, it get a “Number of requests exceeded limit” after 20 iterations, whilst if I hit “Run” in studio, it errors, after 2,000 iterations, and in Play Solo mode, it errors after 500 (which is what the docs say).
Our in game http request limiter depends on the value being 500, so if this dependent on the environment then we need to change it. But I’m pretty sure it’s always been 500, and should be 500.
Can’t reproduce, goes up to 500 for me when I use on a baseplate.
In any case, you probably don’t want to be firing off your entire http budget in the same frame (which is what your code is doing, since you’re spawning it off all at once). There is a concurrent request limit that limits how many outgoing http requests you can have open at once IIRC, more discussion here: https://devforum.roblox.com/t/update-httpservice-wiki-page-to-indicate-3-concurrent-connection-limit/243099. It might be why you are seeing 20 sometimes, maybe it’s dependent on the machine that the server runs on or so. You probably won’t run into that problem as long as you make sure you don’t have massive spikes in your http usage.
So, I ran this in two scenarios, one where I was spawning http requests out in the same frame, and the other where I was not - and the results were the same. In every single test, the results were consistent. 2,000 in studio, 500 in play mode, and 20 in a published game.
The fact that you got different results is strange and really concerns me. Every single time in my published baseplate it errors out at 21. I have published to two separate places, and in both I got 20. I can try publishing to a few more places, and i’ll see if I can reproduce the same 20.
Also, I really think if HTTP Service has a concurrency limit then it needs to be properly documented.
I am currently located in the Toronto area. These requests fire asynchronously (new thread spawned per request, however I saw the same results when the requests ran one after the other)
Sadly this issue still happens today, just as written above. I can make the 500 requests/minute in studio with a single player but cannot do so in a single player server in the actual game. This completely breaks the functionality of my game.
On top of that, there is no documentation whatsoever about this 20 request/minute limit on the developer hub.
Repro place:
Please change this functionality, it doesn’t make much sense to attempt to prevent DDoS’ing endpoints if the basic functionality of HttpService is ruined.
I am also experiencing this as well and I’m glad someone discovered the reason prior to me; I can confirm that in a live-game with only one player in it that the request-limit is 20 per minute.
Not only is this undocumented but it is also ABSURD that this limit is imposed on the already measly 500 requests per minute (and the fact that we do not experience this in Studio either is upsetting).
This issue has been around for a while and is often mistaken for other things:
If anybody wants to reproduce this it’s extremely simple:
1 - Make a server-script and send requests to google on a for loop set to 500 requests at (60 / 500) intervals and print out when the request is being sent (and the index it is at)
2 - Publish the test place and join it from the Roblox app/website
3 - Watch the console as by request 21 you get an error about the amount of requests that can be sent show as exhausted
This is affecting games like Car Crushers 2 for example where certain backend-endpoint functionalities depend on more frequent updates even at the lower scale (since if you exceed 20 it’ll hault just like you would at 500 - which drops a lot of updates that we would want).
For now (if you have a Queuing system, otherwise make one - I highly reccomended it for HTTPService use) the solution is to make your request-limit dynamic according to Player-Count (20 for 1 player, 500 for >1); but again, the biggest downside is you lose a lot of requests.