Brainstorm: Reduce save times

Topics related to Second Age
Post Reply
User avatar
Ronk
UOSA Donor!!
UOSA Donor!!
Posts: 1942
Joined: Mon Aug 04, 2008 10:56 am

Brainstorm: Reduce save times

Post 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 -_-
------------------
The Bloodrock Orcs - http://www.bloodrock.org
Historic Bloodrock

KublaiKhan
UOSA Subscriber!
UOSA Subscriber!
Posts: 85
Joined: Sun Jan 23, 2011 7:29 pm

Re: Brainstorm: Reduce save times

Post by KublaiKhan »

Cub 2?

User avatar
Hans
UOSA Subscriber!
UOSA Subscriber!
Posts: 230
Joined: Mon Aug 17, 2009 1:05 am

Re: Brainstorm: Reduce save times

Post 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.
Image

User avatar
Pristiq
Posts: 1400
Joined: Thu Apr 02, 2009 7:46 pm

Re: Brainstorm: Reduce save times

Post by Pristiq »

Wouldn'yt work well for reasons I cant' get into because alcohol.
chumbucket wrote:Everyone else, don't be a jerk to staff. Maahes cries enough already.


viewtopic.php?f=33&t=40810 - HOLY HELL AN AWESOME VENDOR?!

User avatar
Corbin
Posts: 872
Joined: Tue Feb 02, 2010 12:18 am

Re: Brainstorm: Reduce save times

Post 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.
Image
Pacific (98-02) - Mystic of FL
Catskills (03-08) - Roo Avery of VIT, T^B
UOSA - Amos Trask/Roo Avery of WTC

User avatar
Ronk
UOSA Donor!!
UOSA Donor!!
Posts: 1942
Joined: Mon Aug 04, 2008 10:56 am

Re: Brainstorm: Reduce save times

Post 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
------------------
The Bloodrock Orcs - http://www.bloodrock.org
Historic Bloodrock

User avatar
fox_phyre
UOSA Donor!!
UOSA Donor!!
Posts: 1392
Joined: Sun Dec 06, 2009 6:30 pm
Location: Dennis, Strongbadia

Re: Brainstorm: Reduce save times

Post by fox_phyre »

Pristiq wrote:Wouldn'yt work well for reasons I cant' get into because alcohol.
What she said.
Visit my shop in Yew! First house west of Yew Moongate, always stocked!
viewtopic.php?f=33&t=64975

User avatar
Ronk
UOSA Donor!!
UOSA Donor!!
Posts: 1942
Joined: Mon Aug 04, 2008 10:56 am

Re: Brainstorm: Reduce save times

Post 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.
------------------
The Bloodrock Orcs - http://www.bloodrock.org
Historic Bloodrock

TheBreadMan
Posts: 219
Joined: Fri Oct 01, 2010 10:53 pm

Re: Brainstorm: Reduce save times

Post 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:)

User avatar
Safir
UOSA Subscriber!
UOSA Subscriber!
Posts: 1062
Joined: Fri Mar 06, 2009 6:07 pm
Location: Stockholm, Sweden
Contact:

Re: Brainstorm: Reduce save times

Post 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.
Image

User avatar
Robbbb
UOSA Donor!!
UOSA Donor!!
Posts: 2067
Joined: Sat Jul 10, 2010 10:51 pm

Re: Brainstorm: Reduce save times

Post 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.

User avatar
Brules
Posts: 1867
Joined: Thu Jan 07, 2010 6:36 pm

Re: Brainstorm: Reduce save times

Post 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.

Post Reply