Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

PiotrKFtw

[Suggestion] Make dedicated servers use mulitple threads

Recommended Posts

PiotrKFtw    0

One CPU core/thread usage sometimes isn't enough. Making the server use multiple threads would be great.

Share this post


Link to post
Share on other sites
Daniel86268    214

The DST server actually works fine on "one thread" on my end. It actually uses a little more than one core for other stuff than the main thread.

What system are you running your server on? Is it a VPS by and chance? Those are known for having performance issues on Gameservers.

Or do you have any mods installed?

(A DST Server with two shards runs flawlessly on a Xeon e3 1230 (V1). Tested with like 12 concurrent players and >2000 day worlds without issues so far.)

Share this post


Link to post
Share on other sites
PiotrKFtw    0
22 hours ago, Daniel86268 said:

The DST server actually works fine on "one thread" on my end. It actually uses a little more than one core for other stuff than the main thread.

What system are you running your server on? Is it a VPS by and chance? Those are known for having performance issues on Gameservers.

Or do you have any mods installed?

(A DST Server with two shards runs flawlessly on a Xeon e3 1230 (V1). Tested with like 12 concurrent players and >2000 day worlds without issues so far.)

The server doesn't have any mods. It's running on 4 core VPS 2200 MHz. When the server uses one full core then the performace starts to fall down from Good to Okay or Bad and players report lagging

Share this post


Link to post
Share on other sites
Daniel86268    214
19 minutes ago, PiotrKFtw said:

It's running on 4 core VPS 2200 MHz. When the server uses one full core then the performace starts to fall down from Good to Okay or Bad and players report lagging

Keep in mind you are sharing those cores with other users. Means one core isn't calculating only your server. It's most probably running other applications at the same time as well. So instead of a guaranteed 2200mhz you effectively run your server on like average 800mhz if other players put load on their application as well. (I've heard that virtual cores are sold ~3 times each.) The times when the server "starts using the full core" is probably a general load spike on the datacenter your VPS is hosted from, and not the DST server itself. The virtual core on your server just has less recources to spare on your system. Try a root-server/ a server with dedicated/guaranteed cores instead.

Keep in mind: Developing a software to be properly multithreaded is very difficult and takes a lot of work to do. Paying $2 or 2€ or whatever currency you are using each month for a server with dedicated cores is much easier and cheaper.

Share this post


Link to post
Share on other sites
PiotrKFtw    0
1 hour ago, Daniel86268 said:

Keep in mind you are sharing those cores with other users. Means one core isn't calculating only your server. It's most probably running other applications at the same time as well. So instead of a guaranteed 2200mhz you effectively run your server on like average 800mhz if other players put load on their application as well. (I've heard that virtual cores are sold ~3 times each.) The times when the server "starts using the full core" is probably a general load spike on the datacenter your VPS is hosted from, and not the DST server itself. The virtual core on your server just has less recources to spare on your system. Try a root-server/ a server with dedicated/guaranteed cores instead.

Keep in mind: Developing a software to be properly multithreaded is very difficult and takes a lot of work to do. Paying $2 or 2€ or whatever currency you are using each month for a server with dedicated cores is much easier and cheaper.

The task manager says that the dst server is using 25% of entire cpu other cores are idling or used for something else. Means that server use one full core. The hyper-threading is disabled. The cpu on vps has 4 physical cores. 

Share this post


Link to post
Share on other sites
Daniel86268    214
1 hour ago, PiotrKFtw said:

The task manager says that the dst server is using 25% of entire cpu other cores are idling or used for something else. Means that server use one full core. The hyper-threading is disabled. The cpu on vps has 4 physical cores.

On a physical server you'd be right. On a virtual server things work differently though.

The task manager measures the usage and sleep times on the CPU. Meaning if the CPU is constantly calculating something it doesn't have sleep times, means 100% load. It doesn't matter if this usage is from one task, from two tasks, or one primary task and one task that the Task manager can't see because it's on a different virtualisation level. Your case is the latter. The sleeping cores are doing something else on other machines. This is something the Task manager can't see, so the task manager thinks that the CPUs are sleeping. Some examples how the execution queue looks like:

Physical/dedicated CPU:

Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server

Virtualised CPU with low load from other users:

Your DST Server; Something else; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Something else; Your DST Server; Your DST Server

Virtualised CPU with high load from other users:

Your DST Server; Something else; Something else; Your DST Server; Something else; Something else; Your DST Server; Something else; Something else; Your DST Server

You see how on the first example you got 10 out of 10 executions in that time frame?

On a low useage virtualised environment you still see lots of time for yourself. You still got 8 out of 10 executions.

More problematic are the cases when the host is under high load from various users. In this example you got 4 out of 10 executions.

All of these examples are 100% CPU load on one core. On the first one you got 100% of the performance, the second one still 80% (Which is usually the best case for virtualised environments, because you can utilize the cores better as as provider because of selling them multiple times) and on the last one only 40% of the total performance. Keep in mind these are just examples, and depending on your hoster there might be more or less people on the same server using the same core.

Share this post


Link to post
Share on other sites
PiotrKFtw    0
7 minutes ago, Daniel86268 said:

On a physical server you'd be right. On a virtual server things work differently though.

The task manager measures the usage and sleep times on the CPU. Meaning if the CPU is constantly calculating something it doesn't have sleep times, means 100% load. It doesn't matter if this usage is from one task, from two tasks, or one primary task and one task that the Task manager can't see because it's on a different virtualisation level. Your case is the latter. The sleeping cores are doing something else on other machines. This is something the Task manager can't see, so the task manager thinks that the CPUs are sleeping. Some examples how the execution queue looks like:

Physical/dedicated CPU:


Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server

Virtualised CPU with low load from other users:


Your DST Server; Something else; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Your DST Server; Something else; Your DST Server; Your DST Server

Virtualised CPU with high load from other users:


Your DST Server; Something else; Something else; Your DST Server; Something else; Something else; Your DST Server; Something else; Something else; Your DST Server

You see how on the first example you got 10 out of 10 executions in that time frame?

On a low useage virtualised environment you still see lots of time for yourself. You still got 8 out of 10 executions.

More problematic are the cases when the host is under high load from various users. In this example you got 4 out of 10 executions.

All of these examples are 100% CPU load on one core. On the first one you got 100% of the performance, the second one still 80% (Which is usually the best case for virtualised environments, because you can utilize the cores better as as provider because of selling them multiple times) and on the last one only 40% of the total performance. Keep in mind these are just examples, and depending on your hoster there might be more or less people on the same server using the same core.

So i should buy dedicated server?

Share this post


Link to post
Share on other sites
Daniel86268    214
11 minutes ago, PiotrKFtw said:

So i should buy dedicated server?

There are different tiers of virtualisation.

You have the complete virtualised servers like you have where you have all recources shared.

Then you have "root servers", which are essentially still virtualised servers, but with dedicated CPU cores. Means you have a guaranteed high CPU performance.

And you have actual dedicated servers which are physical machines.

In general I'd recommend root servers for small and medium game servers for their still relatively low price but high consistent performance. They might be called differently on your hoster.

Try and see if your hoster offers like a trial for a server like that. That'd be the best thing to see how the performance is on a server like that.

Share this post


Link to post
Share on other sites
Stamina    18

A month ago I had low end VPS SSD (1vcore 2,4 GHz, 2Go ram), it was fairly enought for 6 slots but for some reasons it became laggy once uptime reached 7 days even with only 4 players in.

And then on advices of @Daniel86268 I tried a dedicated one, I was going first for a 2c/4t 1,86Ghz, 4GB DDR3 and then I ended up with 4c/4t 2,67GHz 16Go DDR3.

It's very good for 8 slots, it's even too much lol so I make 2 more servers, basically I have at the moment 3 servers (overworld+caves) with 8 slots each. When 2 servers (public) are full and 1 (private) remain empty all the cores are around 45-50% so 25% per instances.

Share this post


Link to post
Share on other sites
PiotrKFtw    0
4 hours ago, Daniel86268 said:

There are different tiers of virtualisation.

You have the complete virtualised servers like you have where you have all recources shared.

Then you have "root servers", which are essentially still virtualised servers, but with dedicated CPU cores. Means you have a guaranteed high CPU performance.

And you have actual dedicated servers which are physical machines.

In general I'd recommend root servers for small and medium game servers for their still relatively low price but high consistent performance. They might be called differently on your hoster.

Try and see if your hoster offers like a trial for a server like that. That'd be the best thing to see how the performance is on a server like that.

It has a trial for it. It was now root server everything was good til one cpu core was fully used the server performace started to fall down once again.

Share this post


Link to post
Share on other sites
PiotrKFtw    0

I've tried running it on my pc 3 GHz 4 core cpu and when one core was fully used once again. The host performace started to fall down to okay and if server was full (6 players) then the performace was Bad and players started to lag hard.

Share this post


Link to post
Share on other sites
Daniel86268    214

That is super weird. Never had any issues like that so far. Maybe put that into a bug repot? Because that doesn't seem normal.

Share this post


Link to post
Share on other sites
PiotrKFtw    0
On 11.07.2018 at 10:27 AM, Daniel86268 said:

That is super weird. Never had any issues like that so far. Maybe put that into a bug repot? Because that doesn't seem normal.

How do i report bugs? I never reported bugs so i don't know. 

Share this post


Link to post
Share on other sites

Just wanted to add my two cents here: I have a reasonable knowledge on running games on servers. This game - for whatever reason - is the hardest one to manage performance wise. The CPU load seems way too high for such a "simple" game. The main issue is that it does not seem to support multiprocessing.

Share this post


Link to post
Share on other sites