Raid-Gaming / CoD4-Unleashed-Server

A custom CoD4 Dedicated Server mainly to improve the functionality and usability of the stock CoD4 Server.
https://raid-gaming.net/forum/18-call-of-duty-4-unleashed/
GNU Affero General Public License v3.0
9 stars 8 forks source link

Feature/libcurl http #36

Closed atrX closed 3 years ago

atrX commented 4 years ago

Description

Adds support for HTTPS, HTTP headers, large response bodies, ... through libcurl.

MichaelHillcox commented 4 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.

atrX commented 3 years ago

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.

atrX commented 3 years ago

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.

atrX commented 3 years ago

Closes #29