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 ?
Shared OpenTTD server
Moderator: OpenTTD Developers
Re: Shared OpenTTD server
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.
(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.
Re: Shared OpenTTD server
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.
Re: Shared OpenTTD server
There are a lot of things that benefit from being done on a server that do not need high CPU frequencies.
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Who is online
Users browsing this forum: No registered users and 14 guests