Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
58 user(s) are online (32 user(s) are browsing Forum)

Members: 1
Guests: 57

Jeider, more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +10€

Current balance: -50€
(last updated 06/2019)

Please make a donation if you want to help keeping The-Starport online:

Bitcoin address:
Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 65 users playing Freelancer on 34 servers.
July. 22, 2019

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



System loading in HkIClientImpl::Startup causing high server load when running under wine
Home away from home
Joined:
2008/7/8 21:15
From Germany
Group:
Registered Users
FLServer Admins
Trusted Speciality Developers
Senior Members
Posts: 569
Offline
Took me quite a while to find the cause for the high load. What exactly is
Code:
pub::System::LoadSystem(base->iSystemID);
doing in
Code:
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).

Posted on: 6/27 23:17
Top
Re: System loading in HkIClientImpl::Startup causing high server load when running under wine
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3518
Offline
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.

Posted on: 6/27 23:49
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
Re: System loading in HkIClientImpl::Startup causing high server load when running under wine
Home away from home
Joined:
2008/7/8 21:15
From Germany
Group:
Registered Users
FLServer Admins
Trusted Speciality Developers
Senior Members
Posts: 569
Offline
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.

Posted on: 6/28 15:17
Top
Re: System loading in HkIClientImpl::Startup causing high server load when running under wine
Starport Admin
Joined:
2008/2/26 20:36
From Germany
Group:
Webmasters
Registered Users
Posts: 1768
Offline
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.

Posted on: 6/28 23:33
Top
Re: System loading in HkIClientImpl::Startup causing high server load when running under wine
Home away from home
Joined:
2008/7/8 21:15
From Germany
Group:
Registered Users
FLServer Admins
Trusted Speciality Developers
Senior Members
Posts: 569
Offline
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.

Posted on: 6/30 13:34
Top
Re: System loading in HkIClientImpl::Startup causing high server load when running under wine
Home away from home
Joined:
2008/9/11 15:55
From Somewhere at Moscow
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 1745
Offline
Quote:
with hook under wine. If I remove it, everything is fine.

If to remove hook? Which version?

Posted on: 7/3 17:15
Open Sirius Mod
Top
Re: System loading in HkIClientImpl::Startup causing high server load when running under wine
Home away from home
Joined:
2008/7/8 21:15
From Germany
Group:
Registered Users
FLServer Admins
Trusted Speciality Developers
Senior Members
Posts: 569
Offline
I was talking about the
Code:
pub::System::LoadSystem(base->iSystemID);
line and thus of the resulting preload of the systems in general.

Posted on: 7/4 8:53
Top
Re: System loading in HkIClientImpl::Startup causing high server load when running under wine
Starport Admin
Joined:
2008/2/26 20:36
From Germany
Group:
Webmasters
Registered Users
Posts: 1768
Offline
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.

Posted on: 7/4 10:57
Top