Page 1 of 1

Brainstorm: Reduce save times

Posted: Thu Jun 16, 2011 10:02 pm
by Ronk
This topic is meant as a discussion for those with some knowledge of RunUO and/or software design. Though anyone can input.

What I know:
1. All items/mobiles are serialized and saved as a binary world save.
2. Save times seem to take 10 sec.
3. The world has lots of items that sit in containers and never get touched or moved.
4. The server is restarted every day (I think).

My thought is to do the following is to create a system where unchanged items are not repeatedly saved. If only modified items are saved, then world saves would be far smaller...

- At server startup: All containers in the world are flagged as 'untouched'. The world save is loaded from an untouched database.

- During the server operation, any time a container is opened, moved, or otherwise changed, it is flagged as touched. This includes player backpacks, banks, boxes in houses, etc.

- Each time the world saves, all 'touched' items are saved to a separate temporary save file. Untouched items are not saved, as they have not changed.

- Each day before the server is taken down, the untouched database and the touched database are compared, merged, and saved off as a new untouched database for the next days operation. This process can be slow, as it will only happen once and only happen once players are booted.

- There would also need to be a restore functionality to relaunch the server using both the untouched database and the touched database, just in case there is a server crash. This would be, I imagine, similar to the above merge and save code and would basically be loading all untouched data, then loading touched data (being sure to overwrite any untouched that it encounters).


Obviously, this sounds easy on paper. Implementing it would be another story. I am sure there is some factor I completely missed as well...but thats why its a brain storm -_-

Re: Brainstorm: Reduce save times

Posted: Mon Jun 20, 2011 4:43 pm
by KublaiKhan
Cub 2?

Re: Brainstorm: Reduce save times

Posted: Mon Jun 20, 2011 10:11 pm
by Hans
CUB is a bad word around here. It encourages hoarding, which is the opposite of it's intent.

I don't know diddly about RunUO.

Are the UOSA server specs posted anywhere? It would be interesting to look at. Some of the newer Solid State disks have fast write speeds. In a RAID 1+0 configuration (using 4 high end SSD drives) the save times could be drastically reduced. It might be a lot to ask for on a free shard though.

Re: Brainstorm: Reduce save times

Posted: Tue Jun 21, 2011 5:11 am
by Pristiq
Wouldn'yt work well for reasons I cant' get into because alcohol.

Re: Brainstorm: Reduce save times

Posted: Tue Jun 21, 2011 5:14 am
by Corbin
This thread would be better served on the RunUO forum. None the less, I'm sure there is a reason it's not done that way as it's the most logical way of doing it.

Re: Brainstorm: Reduce save times

Posted: Tue Jun 21, 2011 9:37 am
by Ronk
Corbin wrote:This thread would be better served on the RunUO forum. None the less, I'm sure there is a reason it's not done that way as it's the most logical way of doing it.
Thats why I was thinking. It seems so simply it seems like it shoulda already been done. Which makes me feel as though I am missing something. Good call on the RunUO forum though

Re: Brainstorm: Reduce save times

Posted: Tue Jun 21, 2011 10:48 am
by fox_phyre
Pristiq wrote:Wouldn'yt work well for reasons I cant' get into because alcohol.
What she said.

Re: Brainstorm: Reduce save times

Posted: Tue Jun 21, 2011 1:08 pm
by Ronk
Ok, per this one persons long reply. He says the basic reason its not used is that it would take too much effort to be worth 10 seconds an hour in saved times. Further, he says that if you have some 'dirty' vs 'clean' system, then custom scripts are less plug and play (which is against what RunUO is trying to do).

He also suggests this:
" By the way, I'm assuming this came up on the second age server due to their saves taking a roughly long amount of time. Have you/them/anyone looked into the new .Net 4.0 save strategy created by Asayre? It uses TPL, allowing the save process to spool up the entire save in memory, and using TPL write it to disk while the server keeps running. In testing this had a 20-30% increase in performance on an average server. Perhaps someone over there should look into this. "

I figured id pass that along to Derrick and team in case they haven't looked into it and want to.

Re: Brainstorm: Reduce save times

Posted: Tue Jun 21, 2011 5:07 pm
by TheBreadMan
While the server is stable just make the time between saves longer!! :) 1 save a day is all we need 12hour revert ftw:)

Re: Brainstorm: Reduce save times

Posted: Wed Jun 22, 2011 4:52 am
by Safir
TheBreadMan wrote:While the server is stable just make the time between saves longer!! :) 1 save a day is all we need 12hour revert ftw:)
To be honest, I'd rather wait 30 seconds an hour or so just to feel safe in that the little time I have to spend on UO was well invested. So I think the OP is right on that save times is what the focus should be at, not the frequency of saves.

Re: Brainstorm: Reduce save times

Posted: Wed Jun 22, 2011 12:52 pm
by Robbbb
It doesnt work for several reasons. If you can imagine that instead of having one list to scan and save now you have two lists and you have to scan the first list to see what doesnt need to be scanned on the second list and then scan the whole second list and cross reference what doesnt need to be saved...That is a simple explanation...It may cut down on the actual save time, but not by much and for the amount of coding that would need to go into it it would not be worth the work...

The only thing that makes sense to me is to cut down on the amount of saves. The server is very stable now and I think that one save every 2 hours can be justified. This is just my opinion though.

Re: Brainstorm: Reduce save times

Posted: Wed Jun 22, 2011 1:51 pm
by Brules
CUB 2 then immediately implement the next housing phase with the lockdowns/secures increased #'s. Then if it aint LD'd = decay.

CUB doesn't encourage hoarding people......ITEMS NOT DECAYING IN HOUSES encourages hoarding.

Period.