
Don't worry this isn't another 'Please make Openttd Multithreaded' lol
So we've been running a server for quite a while now which is great.
But we are bumping into an issue where at some point some clients are simply too slow, and the client CPU load is maxing out because of some 'functions'.
The problem we're having is mostly with trains, we can run road vehicles, boats, tons of them, but once the train number goes up, client cpu usage goes up significantly.
What I do know is this: Its not related to pathfinding, more with something else which Developer Rubidium once explained in another Thread.
I did profile the application myself to verify Rubidium's story, just out of curiosity, ofcourse he's right! But who knows it mightve been something else what was causing it.
viewtopic.php?f=32&t=37064&start=60
On the bottom, is where he explains what takes by far the most CPU usage.
Now this is as far as my technical expertise goes unfortunately, and the question isn't how to solve this huge bottleneck in the code itself, which ofcourse would've already been optimized if there was a better way to do so.
But my question is, how do I keep this specific cpu load under control or how to surpress it?
Before we used to play with 8 Trainsets, and I've already reduced it to only 4 but at first glance it didn't seem to affect the cpu load much, though its hard to tell because server load is somewhat different each round.
Questions:
1. Will less (Train) vehicle GRF sets reduce load?
2. Does it also affect road vehicles/trams ships and aircraft?
3. Does the amount of train wagons affect it? I could speculate that having A LOT of wagons behind the train all of those wagons constantly had to 'fetch' data perhaps? or when they make a turn?
4. I assume that speed of the trains also negatively affects the cpu load, thats pure speculation though, but if this would to be true, would enabling Wagon speed limit restrictions kind of surpress the load further?
5. Has map size any direct or indirect effect on this load issue I'm talking about? Or is that totally unrelated to this?
6. Could it be NewGRF specific? Like, some sets have sounds, gearing animation etc, on most you can disable it which I did, could there be 'hidden' stuff that is not visible for the end user on some vehicle newgrf's which occupy a lot of CPU? And if so, how would I be able to discover which sets would be problematic for high CPU load.
Sorry for all the questions, but I'd rather explain properly what I'm talking about (Hopefully)
Thanks in advance.