[Discussion] SaveHandler
Slind14 opened this issue ยท 5 comments
Hey,
besides the corruption's which are hard to track down there are further things I disliked since the start with AG1. It is mainly about the hiccup the world save (hqm save) causes. With a save data file of about 5 MB, the hqm save can take up to 3 minutes on a normal 7200 hdd. Here are a few facts:
- removing the backup as it is, halves the save duration
- moving the save directory from a 7200 hdd to ram disk improves save speed by a factor of 8
- (we delete the records of inactive players (+1 week), this did speed up the save process by about 5 times, ofc it depends on the age of the save data and the server popularity)
- the bit pushing.. avoiding it would probably double the speed not verified
What improvement I imagined about the save handler - if we don't redo it:
- remove the backup as it is
- run it async to a temp location
- once successful completed rename old save and copy it over
=> shouldn't be noticeable even with a lot to save, does not corrupt save file if not successful or terminated (crash). (we do backups of +20 GB servers this way, no hdd/server hiccup, no corrupted saves.. (well we use rsync and hard links to only backup changes but still have the history available at all time, but that shouldn't matter while in the MB's)
Would it make sense to redo the entire data save handler (not the network part) or improve it in performance and stability?
Hmmmm... It certainly would be possible to make some of these changes to improve performance, along with a couple of others
@Slind14 - I take it you are referring to the player.dat file, rather than the actual quest file, correct?
@hilburn yes, the player.dat file in the world directory.