Jump to content
Morendal

Dalam World server optimization up to 500,000 players!

Recommended Posts

Hello, players! Today we’ll talk about optimizing the game server of Dalam World. For us, this was the most interesting and difficult task—so let’s dig into why.

So, no matter what people say about programming languages—no matter which are better or worse—I can say with confidence that almost all modern programming languages hit the limits of their own compilers.

First, let’s break down what a programming language is. In essence, it’s a separate compiler program that converts code into machine code—Elixir, Java, C++, C#, Ruby, etc.

If you think about it, every compiler program has limitations: number of requests, clock cycles, RAM, and so on. Some compilers can work with processor cores; others can’t. But that’s not even the main point. The bigger factor is where the program itself runs. In server hosting, there are two popular server systems: Windows Server and Linux (and other Unix-like systems like FreeBSD). With Linux, distributions are tuned for specific tasks.

But our goal is to keep 500,000 users in one world without lag!

Let’s see how Windows would behave with 500,000 simultaneous connections. Spoiler: the server would crash and wouldn’t be able to handle that many connections that need to be processed, because a bunch of services and processes would simply fall apart.

Now let’s look at Linux. Because it’s open source, you can come up with solutions to the problem. But again—both Windows and Linux are written in C++ and similar languages. Those are compilers with limitations.

In other words: out of 10 server requests to the CPU, 5–7 are spent only on the system (Windows or Linux). That means the server’s КПD (efficiency) is at best around 30–40%, which is very low. In large-scale PvP and sieges, the CPU calculates not only player actions, but also actions of the operating system the server is based on, and the compiler the server is written with.

Basically, in simple terms: due to server software and compilers, the server can’t work with the CPU directly. Instead, it uses the operating system and compiler APIs to communicate with the CPU. It’s the same as if, instead of calling a friend directly, you first call a help desk to get your friend’s mom’s phone number, then call your friend’s mom and ask her to pass the message along.

So, instead of direct contact, there are lots of extra steps—just like with modern systems.

Modern “solutions” aren’t about writing better code—they’re about adding more power. Why write good code, use direct CPU access, and describe actions, if you can hire investors, rent powerful servers, and “flood” the whole game with donations—squeezing out the last pennies from players?

We took a different path. We optimized our code starting from the operating system. We based it on our own OS developments, on which we placed the server—written in low-level languages, just like our OS.

What does that give us?

1) Our server can handle more than 500,000 connections at the same time!  
2) Fully open code  
3) Every CPU request comes directly from the server (КПД 100%)  
4) Easy scalability of the system for any server and any processor  
5) For an online of 500,000 people, we don’t need an expensive server

Because of all this, we spend very little money on hosting. There’s no P2W donation in the game, and our partners receive 40% to 90%.

In the screenshot below, you can see that the server is running. Testers are playing on it now, and smart bots are running asynchronous checks of the server load. At the same time, the server uses less than 2% CPU—on average about 1% CPU (from 0.31% to 1.4%). 

Pasted Graphic.png

For comparison: your Windows system on average uses about 10%, while the server under stress testing by the testers uses only about 1.4% CPU.

All of this was achieved thanks to our technologies.

With these technologies, we’re not afraid of DDOS attacks, because our server can process any powerful DDOS attack that “school kids’ companies” set up to sell their DDOS protection services!

Thank you for your attention!

Share this post


Link to post
Guest
This topic is now closed to further replies.

×