Clear leftover objects

Have a suggestion or an idea for Life is Feudal: MMO ? Post it here!

SINE
 
Posts: 12
Joined: 30 Sep 2014, 16:45

Clear leftover objects

Post by SINE » 30 Sep 2014, 21:16

It would greatly improve both database performance and also reduce memory use if there was an SQL process for deleting unused item containers (especially bags = ObjectTypeID: 1071)

While currently one of our servers is having memory leaking problems, we assume that this is caused by objects like these that never ever get deleted and therefore "trash" the server memory and DB.

I tried looking into the default query functions but have to admit that I can't accomplish a query that will delete ALL connected containers/items of a given ObjectTypeID (I'd like to try it with 1071).
If you're not going to implement this as a feature anytime soon, would you mind giving me a working query process for this task?

Thanks a lot for reading
Last edited by SINE on 01 Oct 2014, 16:17, edited 1 time in total.


Dods
 
Posts: 47
Joined: 01 Apr 2014, 23:04

Re: Clear leftover objects

Post by Dods » 01 Oct 2014, 00:41

We should definitely keep all objects in the world forever so that server memory gets full and the server is unable to operate. This is the only way to program logically. No one should ever need to manage their own memory personally because Windows 95 does it for me.


SINE
 
Posts: 12
Joined: 30 Sep 2014, 16:45

Re: Clear leftover objects

Post by SINE » 07 Oct 2014, 19:23

Any news?


Shu
 
Posts: 84
Joined: 23 Sep 2014, 19:16

Re: Clear leftover objects

Post by Shu » 07 Oct 2014, 23:28

I'm having trouble imagining that even a fist full of bags could have any notable impact on either, memory usage, nor performance. Since they should no longer have an object associated with them (table "movable_objects" contains bags), they are merely never referenced rows in a database. As long as there aren't literally millions of them, you won't feel a thing.

I've just used a couple of SQL statements to look for orphan items and containers, and/or containers without items. On my server, every container of type 1071 has a proper movable_object associated, and at least one proper item that uses it as it's container ID.
And I know for a fact, that on this server bags have been made numerous times, and removed in both ways. (Regular emptying and deleting via GM command.) So it seems to me, that there has to be something wrong on your server, that leads to incomplete bag deletions.
Did you for example apply every new patch.sql that comes with every new server patch? Maybe there was a problem there in the past, but it was already fixed. Shooting in the dark here, though.


SINE
 
Posts: 12
Joined: 30 Sep 2014, 16:45

Re: Clear leftover objects

Post by SINE » 08 Oct 2014, 00:12

Thanks for your answer.

Are you saying that on your servers bags get deleted by themselves?

I'm talking about a general cleanup that should happen regularly (f.e. when the bag is x days old)

Also, animal corpses don't get deleted and can get looted again after a server restart. Don't you have that behaviour on your server?


Shu
 
Posts: 84
Joined: 23 Sep 2014, 19:16

Re: Clear leftover objects

Post by Shu » 08 Oct 2014, 06:19

Aha! Okay, I thought you were talking about mere database entries that don't really have a visible bag in the game. Well in that case things get complicated. How do you discern still active and important bags from orphan bags? I don't have the DB at my current computer, but I can't remember having seen anything that would indicate age. And even then: A once placed bag can very well be used as an active storage for a long time. Chances are, that you really piss off people if you cleaned them away. And they are actually a nice way for newly started chars to help them making a living early on!

Also, even when those bags are still drawn, they shouldn't make any notable contribution to memory and GFX speed. It's not that there's a bag every 5m all across the map, is it?
With animal corpses I don't know really. Haven't looked at if they count as a container, but if server restarts reset their contents, chances are they aren't. Thus you'd probably only find them in the "movable_objects" table. If you know the ID, just delete those entries. Should do the trick.

Same for bags, but you need to cascade the deletion down into the tables "containers" and "items" - aside from the aforementioned problems I see with doing this.


SINE
 
Posts: 12
Joined: 30 Sep 2014, 16:45

Re: Clear leftover objects

Post by SINE » 10 Oct 2014, 14:39

You can guess the age by simply looking at the ID and comparing that to the newest one.... then say you have a minimum ID distance so not the newest bags get deleted all the time.

I don't care who it pisses off and who it doesn't, as I'm just looking for a batch query that does the trick deleting all containers of type X + all their content. If I do that with animal corpses, that would already help establishing more roleplay game-behaviour.

Don't get me wrong, thanks for your point of view but deleting them manually is not really going to be a working solution.

Return to Suggestions and Ideas