Hello good fellows.
Recently, the devs for the game Helldivers 2 mentioned that one of the biggest issues they’re facing is that their backend code was not designed to be able to handle the sheer amount of players they’re getting, and that they’re working hard to optimize it.
I understand the broad strokes of what they mean, TLDR things were made with X people in mind, they ended up getting 10X, things are oversaturated. But how can code only work with so many people at a time? I thought it was a matter of hardware resources like RAM or processing power taken by the code per user, but if that were the case I’d imagine just adding more servers would solve the issue, something they’ve stated won’t really help that much in the long run. So I’m left wondering what really goes into scaling that kind of stuff to accomodate for more users.
Thanks in advance.
In: Technology
Often when writing code, you have to make decisions about how much memory gets allocated to variables. If you expect a variable will never hold values that are too large, you might use a smaller size to save space. It needs to be decided ahead of time because the computer needs to know which bits belong to that variable. It’s probably going to be stored right next to data that belongs to other variables. So if variables are bigger than you expected you need to rewrite code in places to allocate more space.
Another reason code might not be scalable is some algorithms don’t have significant performance difference at a low number of iterations but can be significantly slower at higher ones. There are algorithms where the time taken per iteration lowers as you have more iterations. There are algorithms that scale linearly meaning that the average time taken per iteration stays the same. And then there are algorithms that get exponentially longer to get through when you increase the number of iterations. So it may have been coded in a way that wasn’t optimal, but it wasn’t a problem when there was a low amount of users and then an increase in users revealed how inefficient the algorithm was.
Latest Answers