The International Simutrans Forum

 

Author Topic: Could Bridgewater-Brunel only use one thread for building?  (Read 795 times)

0 Members and 1 Guest are viewing this topic.

Offline Matthew

  • Devotee
  • *
  • Posts: 560
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Could Bridgewater-Brunel only use one thread for building?
« on: November 25, 2020, 05:18:07 AM »
I have just tried to join the Bridgewater-Brunel game and the server have been stuck loading its save for some time. This is almost certainly because it's busy building the nightly.

Looking at the nightly.sh script, the nightly build is set to use three threads (make -j3).

Would it perhaps be sensible to set it to one thread instead, so that the multiplayer server can have as much CPU time and memory bandwidth as possible? The build is an automated process, so no-one is waiting around for it to complete. And it finishes around 0515 (except for the .deb, for some odd reason), so even if the build time was tripled, it would still be finished in time for the restart at 0600.

Your multiplayer works night and day like a champ, but it's unkind to ask it to fight the lag with one hand tied behind its back!  ;)

Offline freddyhayward

  • Devotee
  • *
  • Posts: 660
  • Languages: EN
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #1 on: November 25, 2020, 07:40:12 AM »
Maybe the server should shutdown before the build and wait until the build finishes to restart. Then it would at least appear as offline for that time instead of appearing to be online but not being playable. I doubt it would be playable even with a single build thread.

Offline Freahk

  • Devotee
  • *
  • Posts: 1504
  • Languages: DE, EN
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #2 on: November 25, 2020, 01:05:30 PM »
I totally agree with Freddy.
In addition, using all available ressources on the build will speed it up.
So in the end the player will get a clear response and the effective downtime should be shorter.

Offline Vladki

  • Devotee
  • *
  • Posts: 3718
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #3 on: November 25, 2020, 04:44:53 PM »
Better would be to put "nice -19 " before "make -j3" to make the make process lowest priority, so it will compile only if there are any free CPU cycles left, but will use 3 cores if available.
Or just run the whole script with "nice"

Offline freddyhayward

  • Devotee
  • *
  • Posts: 660
  • Languages: EN
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #4 on: November 25, 2020, 08:50:48 PM »
Better would be to put "nice -19 " before "make -j3" to make the make process lowest priority, so it will compile only if there are any free CPU cycles left, but will use 3 cores if available.
Or just run the whole script with "nice"
Even at minimal CPU usage, memory would still probably have a significant impact on gameplay.

Offline Freahk

  • Devotee
  • *
  • Posts: 1504
  • Languages: DE, EN
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #5 on: November 25, 2020, 10:49:30 PM »
I don't think nice is a good option here as the server already runs out of memory anyways.

Offline Vladki

  • Devotee
  • *
  • Posts: 3718
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #6 on: November 25, 2020, 11:38:58 PM »
I don't think nice is a good option here as the server already runs out of memory anyways.
I tried compiling simutrans-extended, at my home computer (linux), and memory is not the problem. "make -j3" required at most half GB extra. Usually just 200 MB. But if the server is already struggling with memory, then using "nice" and single thread compilation is the way to go. Single thread compilation was fine with just 100 MB of RAM

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20776
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #7 on: November 26, 2020, 02:02:49 PM »
I would suggest that server performance issues relating to loading/saving await the implementation of zstd, which Ranran has recently managed to integrate. I still need to test this and set up the libraries for it, but tests last year showed a significant improvement.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10642
  • Languages: De,EN,JP
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #8 on: November 26, 2020, 02:09:12 PM »
Why not using the builds from github. That would bring zero load to the server.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20776
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Could Bridgewater-Brunel only use one thread for building?
« Reply #9 on: November 26, 2020, 02:16:14 PM »
Why not using the builds from github. That would bring zero load to the server.

This is an interesting idea. These builds are quite new and not something that I have looked into in detail so far. I am not sure whether this works correctly for all platforms at present.