Pesistant Storage - Interim Solutions

General forum for server information, questions, and announcements.

Moderators: Wynna, NWN2 - 03 DM

User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Re: Pesistant Storage - Interim Solutions

Post by AcadiusLost »

See the edit to the stickied topic re: P-storage. The fix is in, and holding. 8)
User avatar
NickD
Beholder
Posts: 1969
Joined: Sat Jul 31, 2004 9:38 am
Location: Auckland, New Zealand

Re: Pesistant Storage - Interim Solutions

Post by NickD »

Well done.

What was the fix?
Current PCs:
NWN1: Soppi Widenbottle, High Priestess of Yondalla.
NWN2: Gruuhilda, Tree Hugging Half-Orc
User avatar
Kest
Builder
Posts: 794
Joined: Sat May 22, 2004 9:20 pm
Location: Flint, MI

Re: Pesistant Storage - Interim Solutions

Post by Kest »

spoonfeeding
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Re: Pesistant Storage - Interim Solutions

Post by AcadiusLost »

NickD wrote:What was the fix?
It started to become clear that the problem was tied to how big the TSM module had gotten, specifically it's memory footprint. BG doesn't have the symptoms, much smaller mod. Exodus' Amn server (on the same core/perisistency scripts) didn't have the p-storage problems before, but has recently started to exhibit them (their module is getting close to TSM in size now). This prompted me to re-test using a pared-down version of TSM which had a smaller memory footprint (by deleting a pile of large exteriors), which turned out to work (though there was still a massive lag hit during the first write operation).

Watching the pagefile usage in Task Manager, I was reminded of a strange but recurrent phenomenon, whereby the first object write to the native campaign DB would cause a big jump in pagefile/memory use (maybe 20-40% increase in overall size), with subsequent read and write operations running smoothly (the pagefile useage would stay high, though). I discussed the finding with Wynna, who wanted me to narrow down the threshold size that was still workable for p-storage, so she could try to trim down the mod sufficiently. In testing a nearly full-sized module, I was able to get a successful DB write with a PC who logged into an interior adjacent to a pstorage object, immediately after a module reset (fresh module, 1 player on, no ATs performed yet, no spawns in area (or active in the module yet), etc. Basically best-case scenario. Seeing that the one successful write was all that was necessary to get stability for the remainder of the module's runtime, we hit on a plan to try to "pre-initialize" the campaign DB.

OnModuleLoad, we added a script which creates a single object at the start location. Arbitarily, I decided to have it make a spoon. The script then stores the spoon in an object database (causing a write operation), and subsequently deletes the in-module copy. The net effect is to get the major lag/performance/memory hit of that first write operation out of the way before anyone has opportunity to log in, such that things are stable and functional for subsequent campaign DB operations elsewhere on the server.

Four lines of code, including the WriteTimestampedLogEntry("There is no spoon"). TSM takes an extra minute or two to load now while it recovers from that first DB write, but seems to be working otherwise.

And so I get to avoid revamping the entire p-storage code to work with BLOBs for a few more months at least, with any luck. :P
User avatar
Rotku
Iron Fist Tyrant
Posts: 6948
Joined: Tue Jan 06, 2004 1:09 am
Location: New Zealand (+13 GMT)

Re: Pesistant Storage - Interim Solutions

Post by Rotku »

Now that's out of the box thinking. Nice work, AL :)
< Signature Free Zone >
User avatar
Ithildur
Dungeon Master
Posts: 3548
Joined: Wed Oct 06, 2004 7:46 am
Location: Best pizza town in the universe
Contact:

Re: Pesistant Storage - Interim Solutions

Post by Ithildur »

Brilliant. The simplest and most elegant solutions are often the best. Gotta love the spoon bit. :D
Formerly: Aglaril Shaelara, Faerun's unlikeliest Bladesinger
Current main: Ky - something

It’s not the critic who counts...The credit belongs to the man who actually is in the arena, who strives violently, who errs and comes up short again and again...who if he wins, knows the triumph of high achievement, but who if he fails, fails while daring greatly.-T. Roosevelt
User avatar
Brother Humphrey
Kosher Kojak
Posts: 1116
Joined: Wed Aug 18, 2004 12:59 pm
Location: Hadera, Israel

Re: Pesistant Storage - Interim Solutions

Post by Brother Humphrey »

Just goes to show that spooning afterwards really does promote harmony
<paazin> Elves I bet are kinda fun to play.
<BH|werksux> I prefer the trumpet or clarinet
<BH|werksux> elves wiggle too much

Current Server: TSM

Current PC: Delshandra
Pwned PCs: Lemuel,Skimmer,Clevon,Juno,Gilbert,BH,Dunkin,Osk & Rodney

Current Status: Highly Mobile
HEEGZ
Dungeon Master
Posts: 7085
Joined: Wed Dec 28, 2005 4:17 pm
Location: US CST

Re: Pesistant Storage - Interim Solutions

Post by HEEGZ »

Brother Humphrey wrote:Just goes to show that spooning afterwards really does promote harmony
:eek:
User avatar
hollyfant
Staff Head on a Pike - Standards
Posts: 3481
Joined: Mon Oct 24, 2005 3:33 pm
Location: the Netherworl... lands! I meant the Netherlands.

Re: Pesistant Storage - Interim Solutions

Post by hollyfant »

Spoon!

Image
User avatar
dob85y
Ogre
Posts: 692
Joined: Mon Jun 30, 2008 7:55 am
Location: Sydney, Australia

Re: Pesistant Storage - Interim Solutions

Post by dob85y »

AL and Wynna,

Your geniuseseses has once again made all things right with the world of ALFA.

Thank you
"thats dob85y, sound it out! - d o b b s y"
"Hey man, this aint no game, this is serious"

Shiver

Previous Toon
Ward Halliams - Priest of Kelemvor
Tirus Blazingeye
Ryu Yahchamazina Shield of Helm - Everwatch Knights
Post Reply