Closed atrX closed 3 years ago
Intense lag with a log of queries, stalls the entire server. I've been doing some testing locally to move our mod over to this system and with 20 clients in an a map_restart it'll bring the server to it's knees haha.
Edit: You can get the same result from with less players but it's harder to notice. Testing enviroment is a WSL ubuntu running B3 1.12, This exact branch for linux and a test API written in Nest.js running on localhost.
Set up a test API myself and sent 64 simultaneous requests to it that resulted in the server hanging and eventually killing a "potential infinite loop". That's not an error I would expect when calling engine functions so I removed the JSON decoding from my test code... 64 (smaller) requests firing all at once with minimal impact. So I'll need to look into optimizing the JSON parsing... Not fun.
Seems to handle individual requests quite well as long as they don't get too big.
I was definitely going to add a notice about optimizing requests in the docs once we drop the next release but I'll see what I can do to improve performance as-is.
Don't see an immediate way of improving performance of the JSON module. As discussed in Discord, moving it to C would be a pain. I'll keep the option on the table but for now I'd say it should suffice to simply optimize the API the game's interacting with. Meaning:
Merging this in since the performance issue isn't directly related to the HTTP module.
Closes #29
Description
Adds support for HTTPS, HTTP headers, large response bodies, ... through libcurl.