Server - cleaning period

Discussions about Servers
Post Reply
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Server - cleaning period

Post by sektor2111 »

I'm showing you a "ServerActor" intended for cleaning garbage objects at random intervals of time in a server.
This actor works without major dependencies because it's simple.

However, it will "smell" if you have XC_Core5 by Higor loaded in server and it will use available clocking system in order to see time taken for purging garbage. Yes, it takes a bit (you'll figure). If this Actor is useful feel free to use it as you want.
[attachment=0]Garb.zip[/attachment]
Usage:
ServerActors=Garb.Garb
Source-code for modifications is located inside archive. To not forget to say, it is based on what Higor was mentioning somewhere in forum...
Attachments
Garb.zip
(47.97 KiB) Downloaded 124 times
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Server - cleaning period

Post by sektor2111 »

I'm back with a note:
It looks like in Levels which are suffering powerful tweaks from Mod this garbage collecting operation is not a good idea. It is the second time when a map which was working somehow before starts to piss me off crashing. I'm not sure what exactly happens. I have changed folders structure in purpose to gain HDD space, nothing has been changed in functionality except the same crash as in default server methods. The tool works but is not a solution for getting rid of stuff like that.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Server - cleaning period

Post by MrLoathsome »

Interesting. I have been debating with myself the last few months whether or not to include code to
do that sort of thing with my SwarmSpawner project. (Flush caches, garbage collect every 10-20 min, etc...)

Decided just a few days ago it was pointless mostly. Main issue seems to be the "random" crashes you have also noticed.

My best guess at this point in time is the "randomish" timing differences that happen between server and client, and
ALSO the timing differences that happen between between the player and his local machine, :shock: , are the root cause of
many problems.
I strongly suspect there is also a similar timing issue occurring between the Uscript and the native code.

Every mod, every mutator, every map, every difference in server config will have a slight effect on this I think.
You won't get the same results twice. (If you do, start buying lottery tickets.....)

There are so many variables involved, that it seems unlikely to ever get this exactly 100% in sync.

Brute force attempts to clean things up, will result in seemingly "random" issues/crashes due to whatever
current state the whole game is in at that point in time and some actor or another will not be inclined to be cleaned up at that point....

Best plan is to write any new code, or fixes, so that it accounts for this. Work with the Engine. Don't fight it.

*DISCLAIMER.
I been drinking a few beers to celebrate tonight's successful coding session, and might be rambling a bit.

Correct me if I am wrong/way off base with the above ramblings....... :ironic:
I do know a bit about making Levels suffer from powerful tweaks. :satan:
blarg
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Server - cleaning period

Post by sektor2111 »

Wait a minute, I'm not done yet here... I will revert some updates and I'm gonna see how things works. If is about one single map, that one will take a visit through Editor because I'm interested about details...

As I know so far GARBAGE is called whatever object/actor attached loaded by server which is not used anymore in any dependencies. Example of stuff unloaded is Starter mutator. At first garbage collecting operation it gets unloaded properly, the same as other toys working only once, this way memory is being released by useless stuff loaded. I was happy at using it, until some Voodoo magic started to bug me... I'm gonna do some checks, week-end has arrived...
Level crusher has that default DistanceLightning which I'm sending in trash and operating my tweaks - I must detect somehow if is not hanging by something which later gets mad at garbage removal.

Edit:
Suspecting a "seeker" with RouteCache[x] cleaned due to some conditions. Interesting...

Edit2:Meh boys, drew conclusion, a routeCache has been assigned for a seeker. Due to some NON-Navigation conditions, routes actors to target have been Null-ed. All right, garbage went to remove references because are no longer linked to Level But they still have Instigator in Level. New Call to Navigation simply went bad due some nasty removal and then... Garbage Collector is bugged at this point. Let me guess... using "ClearPaths()" drives to the same result (I hope not) ??? That's why is not used intensive except state hunting from Bot ??? So Bot might do nasty things then ? Woow, it's an amazing chain heading to a stupid crash. Aside, it did not crashed too much before at MBot, because I was removing that dumb stupid thing from hunting.
No problem... I'm gonna edit something...
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Server - cleaning period

Post by sektor2111 »

Bump:
I've changed this garbage tool with a timer-free version, no longer using timer for time count. Mod and Source-Code above:
[attachment=0]Garb_St.zip[/attachment]
Attachments
Garb_St.zip
(49.8 KiB) Downloaded 93 times
Culprit
Novice
Posts: 9
Joined: Mon Sep 14, 2015 8:22 pm

Re: Server - cleaning period

Post by Culprit »

This is just what i need. Some monsterhunt maps last a long time and the unloading issue is getting very annoying. Not many players will hang around for 5+ minutes, if theyre left on the connecting screen. Ill try the st version first. Many thanks for your work! :)
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Server - cleaning period

Post by sektor2111 »

Just keep an eye on server with this. I have to stop it with last XCGE (which already has better techs). Such a garbage removal way operated while was firing Minigun against a monster. Then... it crashed, that's why I cannot say it's the best ever idea for being used with different stuff. The second version doesn't use timer but it does the same thing. Garbage is a problem for UT but some times might not be that healthy.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Server - cleaning period

Post by Barbie »

I'd run garbage collection (GC) only if no players are connected. If the aim of GC is saving time on unloading map, you win nothing, if it is done during playing - the time is just shifted from unloading moment to playing moment.

BTW: I had a quick look at the code and stumbled over the following:

Code: Select all

if (Level.Millisecond < 10)
	AbsoluteTime = AbsoluteTime$".0"$Level.Millisecond;
else
	AbsoluteTime = AbsoluteTime$"."$Level.Millisecond;
Because Millisecond indicates 1/1000, I guess the following would produce the correct time display string:

Code: Select all

if (Level.Millisecond < 10)
	AbsoluteTime = AbsoluteTime $ ".00" $ Level.Millisecond;
else if (Level.Millisecond < 100)
	AbsoluteTime = AbsoluteTime $ ".0" $ Level.Millisecond;
else
	AbsoluteTime = AbsoluteTime $ "." $ Level.Millisecond;
But who is interested in correct milliseconds? :lol2:
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Server - cleaning period

Post by sektor2111 »

Barbie wrote:But who is interested in correct milliseconds? :lol2:
I don't know :lol2: .
The problem is that I have some skill in using copy-paste and I did not feel any pain at copying some codes from Statlogs whatever. Actually because I don't use those things but I was curious how do they work I have copied all required data for anyone who wants to use or figure those things. They are not that harmful as is removing an object still linked with action - in that moment funky things are happening... Any default innocent actor become evil as devil in that case.

Else I think you get the right track. Perhaps I shouldn't purge garbage while player is there - and neither later ( my case - because Bots are still mooing there ) when I'm drinking a coffee in my armchair without to play in that moment.
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: Server - cleaning period

Post by Higor »

You don't need to use the GC if XC_Engine is preventing the name list from growing.
Culprit
Novice
Posts: 9
Joined: Mon Sep 14, 2015 8:22 pm

Re: Server - cleaning period

Post by Culprit »

Had this installed for a few weeks now, no unusual crashes noticed so, very grateful for this great idea :)
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Server - cleaning period

Post by sektor2111 »

Glad to hear that. But I will describe some facts occurred to me:
1)
- some MH map loaded (no names at moment);
- Lightning tweaker ruining bDeleteMe lights - probably a bad move which I'm suspecting - I have changed those...;
- a path tester running to gain where mission has arrived (map with Bot support of course I'm not using shite).
Human seeker (me in cause) at a moment I was in some "state" then garbage collector purged some "garbage" which was not supposed - I suspect my routecache points have been nullified = a shit game crash was the next move according to None objects having Pawn Spawner/Owner still in Level.
2)
Another time, I was hunting in a "map" ugly textured after all (cannot recall name this time) and firing minigun (operation specific for MH due to monster health). During this time, garbage collector attacked the job on purpose and Minigun.NormalFire.Tick.Blabla went evil crashing server.

I won't dig deeper these things as long as they are C++ (garbage collector) and... there are more classes using Tick and such. Probably I won't remove garbage during game because looks like my environment (more death and noise and fight) is not for such operations (starter and the rest were unloaded indeed) but later... game turns in lottery.

Give said occurrences I feel my duty to warn you according to these facts. If you don't have new XC stuff or you have other sort of environment probably is good as it is, or simply machine used by your server is really fast purging garbage instantly without to affect action, so it might be helpful.
Post Reply