twohoursonelife / OneLife

Two Hours One Life, building upon One Hour One Life. Join us on Discord to play.
https://twohoursonelife.com
Other
49 stars 38 forks source link

Reduce excessive OneLife server startup time #153

Closed connorhsm closed 1 year ago

connorhsm commented 2 years ago

Potentially related to causes of #151

The game server is taking in excess of 30 minutes to restart currently.

I'd like to package the server and leave it here for testing, but need to confirm there is no private data within first.

Watching startup currently after executing ./OneLifeServer

Culling curseCount.db found 4 total entries, 4 stale, 0 non-stale
Loaded 0 animations from animations folder
Decompressing took 0.077000 seconds
Object id 2482 (The Apocalypse# monumentCall) seen as an apocalypse trigger
Loaded 7173 objects from objects folder
  Auto-generated 5703 'used' objects
  Auto-generated 850 'variable' objects
Decompressing took 0.000000 seconds
Loaded 369 categories from categories folder
Decompressing took 0.006000 seconds
Loaded 10019 transitions from transitions folder
Auto-generated 14808 transitions based on categories
Auto-generated 3876 transitions based on pattern categories
Run 0:  Auto-modified 516 transitions based generic use transitions and auto-added 1703 last use generic transitions (65 objects had generic use transitions defined).
Run 1:  Auto-modified 47 transitions based generic use transitions and auto-added 1703 last use generic transitions (65 objects had generic use transitions defined).
Auto-generated 53495 transitions based on used objects, 589 removed in the process.
Auto-generated 3929 transitions based on variable objects.
foodLog starting up
failureLog starting up
Reading map rand seed from file: *********

Above takes seconds, the below has been running for 20 minutes, spread over each different step.

Loading lastEveLocation ***,***
Overriding eveLocation with shutdownLongLineagePos ***,***
Shrinking hash table in map.db from 13333945 down to 13333945
Cleaned 1 / 85337244 stale map cells from map.db

Shrinking hash table in mapTime.db from 10852251 down to 10852251

It will likely take searching through Jason's upstream change log to understand exactly what each step is doing and whether we really need it here at 2HOL. A lot of those shrinking steps seem to do nothing, but take considerable time.

connorhsm commented 2 years ago

It may help if we have a separate log file saved of the startup, with timings, that can easily be exported.

risvh commented 1 year ago

Fixed with https://github.com/twohoursonelife/OneLife/commit/62780275b79cd78ef9b1c83434f2ac91ac84fe98