Reduce Server CPU-Usage drastically

Since the high number of trains in our games and the complexity of our networks, CPU-Usage is a real problem! Therefor we reduced the number of trains to 400 on the sandbox! But this will probably change within the next days. Today we found something out, all of you and especially the Server Hosts should be interested in.

NOTE: this code parts belong to a dedicated server:

All of you know this part of openttd.cfg

[misc]
display_opt = SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|FULL_DETAIL
resolution = 1680,967

Today we changed this excerpt to this:

[misc]
display_opt =
resolution = 1,1

And now the magic starts, the CPU-Usage dropped from an average of 83%-87% to unbelievable 47%
That’s amazing!

Only one strange thing: the description page for the resolution of the official Wiki says its a client-only setting. But as our tests show, this is somehow not true.

All of you Server Hosts out there, should change the config! Also the coopetition branch is on the way and will probably show up this week! We will have a look at this and try to deactivate the gfx rendering completely!

Stay tuned, Osai.

6 comments so far

  1. Brianetta September 4, 2006 22:18

    Well, there goes my plan for online screenshotting for the chatlogs… a resolution of 1×1 will make them rather uninteresting.

  2. DaleStan September 4, 2006 23:12

    They *ARE* client only-settings. And the dedicated server is a client.
    The only difference between a dedicated server and a non-dedicated server is that the actual putting-the-graphics-on-the-monitor bits don’t run. Apparently, the get-ready-to-put-the-graphics-on-the-monitor bits do run, and therefore setting the server to “display” less information (display_opt=) over a smaller area (resolution =1,1) will make it go faster, since there’s less work to be done.

  3. Osai September 5, 2006 20:31

    yep, but in fact a server-side graphic calculation is total useless! For what do we need it? This should be real difference between a client and a server – no GUI stuff to cope with!
    For screenshots, a temporary rendering of an area would be nice:
    screenshot ‘giant|normal’ ‘resolution’ ‘coordinate’ would be nice, but as this is not possible yet! Something like this would already be enough and thats my solution for your Autopilot Brianetta:

    – pause
    – _change the resoultion somehow_
    – scrollto 0xFFFF
    – screenshot no_con
    – _change the resoultion somehow_
    – unpause

  4. Brianetta September 5, 2006 22:06

    As it is, I’m saving myself some work by removing the screenshot feature. It’s only half complete at the moment, so it’s not a biggy. I hadn’t told anybody that I’d designed it (although they might have wondered at the “screen” field in the database) so there are no dashed hopes either.

  5. TheDancinZerg September 6, 2006 23:03

    Did you try to change each of the options one at a time? So that way we would know if one particular option creates heavy cpu usage for servers. But still really good work! =)

  6. YOYO December 30, 2006 19:48

    Did make the changes to my server CFG

    unfortunaly it doesnt work here.
    Could it be that im running windows or something like that?

Leave a comment

Please be polite and on topic. Your email-address will never be published.