System loading in HkIClientImpl::Startup causing high server load when running under wine
-
Took me quite a while to find the cause for the high load. What exactly is
pub::System::LoadSystem(base->iSystemID); ```doing in
bool HkIClientImpl::Startup(uint iDunno, uint iDunno2)
With it I am getting very high server load running the server with hook under wine. If I remove it, everything is fine. Besides the systems get loaded multiple times, due to the bases getting iterated and not the systems. So this should be changed anyway. But back to the main question: What happens if I remove it? Why is it loaded "before the server becomes internet accessible" like the comment says? I am switching our server to Linux and this seems to be the last remaining problem. I even patched the anti-ddos.dll for the different dpnet.dlls (I will upload this soon).
-
I believe this was done to sorta cache the systems which improved performance when actually loading the systems later on when a player logged/jumped. Don’t know why it’s iterating over bases though.
It can also be useful while doing system editing since some errors will pop up straight on server startup.
-
Yeah, I thought that having them loaded at startup might help finding errors in the ini files. Was not sure about caching, though.
I did some tests and having them load only once was inconclusive due to the random NPC spawn behaviour. The idle load however is reduced if I don’t load them at all at startup. It jumps from 4ms down to 0 and CPU load also goes down significantly. I need to run more tests to see whether this has an effect when the server is not idle, but currently I got the impression it does.
In the meantime I am going to remove it and see what happens. Hopefully this is not just the manifestation of another side effect. I need to find out whether this is wine related or not. The CPU of the server is quite old, so this is also a factor. At least I can switch the server to newer hardware if it is just a load problem. -
I think it was mostly for error-checking on startup reasons but it probably also reduces some serverload spikes when entering a system. But yeah, I think it causes a slightly higher base-load. If you run the server long enough, you would run into a similar base-load since players will have most likely visited almost all systems.
-
I see. I was hoping that the load would just be what happens when lots of systems are loaded. So far everything seems to work. Since I did not notice any lag spikes and the server gets restarted every 12 hours I am going to leave the preloading out. There is no need to waste cpu cycles and power
If you guys have no issue with it I would change the hook svn version to have this as an option in the flhook.ini. So one can choose to disable it.
Also I wrote a new server manager, since dspm does not run well in wine because of dot net. It is not finished yet, but when it is I plan to release it. Currently it just connects to hook and restarts the server after some warnings and in case it crashed.
-
with hook under wine. If I remove it, everything is fine.
If to remove hook? Which version?
-
I was talking about the```
pub::System::LoadSystem(base->iSystemID); -
I think there was another reason i.e. if you want to use some FL Api functions for querying market data for bases, the base has to be “loaded” and the only way to do that was to load the whole system. So if you have hook functionality where you need to query all bases (i.e. we did this for our dynamic economy implementation) you would have to load the whole universe at startup so you can query all bases.