Shared OpenTTD server

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
bazzilio
Engineer
Engineer
Posts: 1
Joined: 12 May 2021 17:37

Shared OpenTTD server

Post by bazzilio »

Hello, i've run OpenTTD server for russian community.

The problem is - when i run my server on 2048*1024 map, my CPU is up to 80% usage and server game is slowing down.
my server config is 1*2.2Ghz CPU + 1Gb RAM

Some notes:
- when i had 3 companies, and 150 trains - usage was about 40%
- when i had 10 companies and ~2000 trains - 80-95%

Questions:
1. Is OpenTTD single-thread, if i request 2 CPU the problem would gone ?
2. How can i reduce CPU usage:
2.1 Stop Trees growing
2.2 Probably ban Path Signal (?)

Could you suggest - how can i boost up my server ?
- Increase CPU core count
- Increase CPU frequency (2.2->3.2Ghz)
- Disable some settings on the server side ?
User avatar
jfs
Tycoon
Tycoon
Posts: 1759
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Shared OpenTTD server

Post by jfs »

OpenTTD only has very little benefit from multiple CPU cores. The game is fundamentally single-threaded, because multithreading makes it difficult to guaranteed that the result of simulations are repeatable.
(For example, if one thread simulated road vehicles and another thread simulated trains, then imagine if on the server a road vehicle moved before a train moved, and for that reason went into a level crossing before the train started going through, but on the client the train moved first and the road vehicle stops before the level crossing as a result. On the server the train would crash into the road vehicle, but on the client everything would be fine. Then you have a desync. Running everything single-threaded avoids problems like this.)

More vehicles has more simulation cost, simple as that. Consider limiting the number of vehicles per company.

Tree growth has some cost yes, experiment with disabling it.

Please tell everyone to use more path signals, they are easier to use and get good results from, and it's a myth that they have more CPU usage, they do not.
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: Shared OpenTTD server

Post by Taschi »

bazzilio wrote: 12 May 2021 18:05 - Increase CPU frequency (2.2->3.2Ghz)
On a side note, I am utterly amazed that hosting companies actually sell servers that have a lower CPU frequency than the budget laptop I got in 2010.
User avatar
kamnet
Moderator
Moderator
Posts: 8582
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Shared OpenTTD server

Post by kamnet »

Taschi wrote: 12 May 2021 19:02
bazzilio wrote: 12 May 2021 18:05 - Increase CPU frequency (2.2->3.2Ghz)
On a side note, I am utterly amazed that hosting companies actually sell servers that have a lower CPU frequency than the budget laptop I got in 2010.
There are a lot of things that benefit from being done on a server that do not need high CPU frequencies.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 19 guests