logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
xp_fastboot - improvements to nwn2server startup times

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sat Aug 23, 2008 21:48    Post subject: xp_fastboot - improvements to nwn2server startup times Reply with quote

xp_fastboot is an NWNX4 plugin that improves server startup times by making hard links to module data in the currentgame directory, instead of the default behavior of making a full copy of all module data. For xp_fastboot to function, the TEMP directory used by nwn2server must be on the same logical drive (i.e. drive letter) as the directory where you are loading your module (or module directcory) from.

Current xp_fastboot version: 0.0.1 for any NWN2 version.

Binaries: http://www.nynaeve.net/Skywing/nwn2/xp_fastboot/xp_fastboot.zip
Binaries + symbols: http://www.nynaeve.net/Skywing/nwn2/xp_fastboot/xp_fastboot_dist.zip
Source: Available at virusman's NWNX4 repository (SVN http://nwn.virusman.ru/svn).

The Visual C++ 2005 SP1 x86 runtimes are required. You can download these here if you have not already installed them: http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1a-4a14-984d-389c36f85647&displaylang=en

Normally, nwn2server copies all module data (either the .mod file or the entire contents of the module directory in directory mode) to a subdirectory under the temp folder. This can take a long time if you have a large module, and is especially slow when you are running the server in directory mode as the server is forced to write out many small files.

Creating a hard link instead of making a full copy of all of the data makes server startup much easier on the disk and filesystem cache, and should prevent pegging the disk as well as paging things out to expand the filesystem cache to contain the entire module all at once.

Note that when using xp_fastboot, you must completely stop all server instances using a given module before replacing the module contents. In other words, when using xp_fastboot, you can no longer replace the module contents while the server is running, and then just have them picked up on the next server restart.

There are no config file options for xp_fastboot. If you want to disable this functionality, then simply delete or move away xp_fastboot.dll.

xp_fastboot supersedes the "suppressModuleCopy" feature in my NWNX4 build. It also improves upon the suppressModuleCopy feature by enabling it to work with directory mode modules.

Note that even with xp_fastboot, you will in general see faster server startup times with a .mod file instead of in directory mode (at least in my experience). However, you should see improvements to startup times in either case when using xp_fastboot.

Troubleshooting:

- If you are getting error 17, this means that the TEMP directory used by nwn2server and the directory where you are loading the module data (.mod file or directory mode module) aren't on the same logical drive. For example, the TEMP directory might be in C:, and the module data might be in D:, or some other drive letter. To fix this problem, either move the TEMP directory for the user to the same logical drive as the directory containing the module data, or move the module data directory to the drive containing the TEMP directory.


Last edited by Skywing on Sun Nov 16, 2008 22:51; edited 1 time in total
Back to top
View user's profile Send private message
GodBeastX



Joined: 09 Aug 2006
Posts: 65

PostPosted: Thu Aug 28, 2008 18:02    Post subject: Reply with quote

Excellent idea. Does this work despite hak paks and override?
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Thu Aug 28, 2008 18:59    Post subject: Reply with quote

Hak / override files are not copied, only the .mod file (or contents of the module directory in directory mode).

The operation of xp_fastboot should be independent of those factors. (The environment I have access to uses both, for what it's worth.)
Back to top
View user's profile Send private message
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Wed Sep 03, 2008 0:27    Post subject: Reply with quote

this will improve harddrive life for sure with huge pw module
Back to top
View user's profile Send private message
MadK@



Joined: 01 Aug 2007
Posts: 7
Location: Perth Western Australia (+9GMT)

PostPosted: Wed Nov 12, 2008 16:32    Post subject: Reply with quote

Skywing this plugin rocks.
It literally cut the server start up time by 50%
_________________
www.avlis.org
www.avlis2.org
Back to top
View user's profile Send private message
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Sun Nov 16, 2008 19:55    Post subject: Reply with quote

i got this error with nwnx 0.8

Code:
2008-11-16 18:41:06 : * Creating link at 'D:\jeux\Neverwinter Nights 2\temp\NWN2\CURRENTGAME.0\\a02_bear_spirit.UTC' to 'C:\Mes documents\Neverwinter Nights 2\modules\erethildummies\a02_bear_spirit.UTC'.
2008-11-16 18:41:06 : * Failed to create hard link - 17.
Back to top
View user's profile Send private message
Wyvern76



Joined: 16 Nov 2008
Posts: 3

PostPosted: Sun Nov 16, 2008 22:43    Post subject: Reply with quote

This wonderful sounding plug in simply does not work for us.

The xp_fastboot log reads this every time:


Code:
2008-11-16 14:30:28 : NWNX FastBoot Plugin 0.0.1
(c) 2008 by Skywing
Visit NWNX at: http://www.nwnx.org

2008-11-16 14:30:28 : * Module hard link hook installed.
2008-11-16 14:30:28 : * Plugin initialized.
2008-11-16 14:30:33 : * Creating link at 'C:\Users\MATTMU~1\AppData\Local\Temp\NWN2\CURRENTGAME.0\\0b_backupdancer_hb.NCS' to 'D:\Neverwinter Nights 2\modules\Obsidian Shore v153\0b_backupdancer_hb.NCS'.
2008-11-16 14:30:33 : * Failed to create hard link - 17.
2008-11-16 14:30:33 : * Failed to create hard link - 17.
2008-11-16 14:30:33 : * Failed to create hard link - 17.


And hard link errors for ever and ever...


Running on a Vista Ulitmate 64 machine

To be fair, I can't find "'C:\Users\MATTMU~1\AppData\Local\" either. Damn Vista
_________________
Wyvern76, Lead Scripter and Host of Obsidian Shore Persistent World
Back to top
View user's profile Send private message Visit poster's website
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sun Nov 16, 2008 22:48    Post subject: Reply with quote

The module directory must be on the same logical drive as the TEMP directory for the user that nwn2server runs as. Error 17 means that the TEMP directory is on one logical drive, and the module load directory is on a different drive.

This requirement exists due to how hard links function under the hood (internally, they are an extra filename pointing to the same disk file on the same file system, and thus cannot cross differing file system instances).

If you make sure that the TEMP directory is on the same drive as where you're loading the module from then you shouldn't have the error 17 issue anymore.
Back to top
View user's profile Send private message
Wyvern76



Joined: 16 Nov 2008
Posts: 3

PostPosted: Mon Nov 17, 2008 0:13    Post subject: Reply with quote

I keep changing the temp dir from with in the NWNX4.ini but the change never takes.

Code:
# You can override the tempory path NWN2 uses
# This is where NWN2 will put its logfiles (among other files)
# no default
;nwn2temp = "D:\Neverwinter Nights 2\Temp Files\"


I tried moving just the mod dir and pointing to that to load from but the server will not load mods from just anyplace.

My system has the actual My Documents moved to D: for safety away from the C: where windows tends to get formated[/code]
_________________
Wyvern76, Lead Scripter and Host of Obsidian Shore Persistent World
Back to top
View user's profile Send private message Visit poster's website
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Mon Nov 17, 2008 0:14    Post subject: Reply with quote

Can you change the TEMP/TMP environment variable settings for the Windows user account that is used to launch nwn2server?
Back to top
View user's profile Send private message
manwe



Joined: 07 Jan 2015
Posts: 1

PostPosted: Wed Jan 07, 2015 0:35    Post subject: Reply with quote

Forgot my old Username here, created a new.
Anyhow, I get this error msg from the Log:

Quote:
2015-01-06 17:07:08 : NWNX FastBoot Plugin 0.0.1
(c) 2008 by Skywing
Visit NWNX at: http://www.nwnx.org

2015-01-06 17:07:08 : * Module hard link hook installed.
2015-01-06 17:07:08 : * Plugin initialized.
2015-01-06 17:07:11 : * Creating link at 'C:\Documents and Settings\Administrator\My Documents\Neverwinter Nights 2\NWN2\CURRENTGAME.0\\amr_it_brass_lantern.UTI' to 'C:\Documents and Settings\Administrator\My Documents\Neverwinter Nights 2\modules\TRS_UnfinishedTales\amr_it_brass_lantern.UTI'.
2015-01-06 17:07:16 : * Failed to create hard link - 123.
2015-01-06 17:07:16 : * Failed to create hard link - 123.


Any idea?

Or is this plugin still active?
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sun Feb 08, 2015 19:44    Post subject: Reply with quote

Apparently I didn't log the file name in the error case, so that's a bit less helpful in diagnosing what happened. Sorry about that.

Can you install Process Monitor and filter to failures in write operations through to the point in server startup where you observe this event? We can examine the Process Monitor log to see what happened from there.
Back to top
View user's profile Send private message
Mythyzyn



Joined: 27 Feb 2015
Posts: 9

PostPosted: Fri Feb 27, 2015 2:30    Post subject: Reply with quote

Hello there

I just tested this plugin looking great, but it still copying the modules files in the temp directory. I check many times, deleting temp contents before.

(Server run a in module directory mode)

But all looks OK, is this normal ?

nwnx.txt
Code:
* Loading plugins...
* Loading plugin xp_bugfix.dll: Successfully registered as class: BUGF
* Loading plugin xp_craft.dll: Successfully registered as class: CRAFTER
* Loading plugin xp_fastboot.dll: Successfully registered as class: FASTBOOT
* Loading plugin xp_hashtable.dll: Successfully registered as class: HASHSET
* Loading plugin xp_mysql.dll: Successfully registered as class: SQL
* Loading plugin xp_srvadmin.dll: Successfully registered as class: SRVADMIN
* Loading plugin xp_time.dll: Successfully registered as class: TIME
* General protection fault error dialog disabled.
* NWNX4 activated.


xp_fastboot.txt
Code:
2015-02-27 01:24:34 : NWNX FastBoot Plugin 0.0.1
(c) 2008 by Skywing
Visit NWNX at: http://www.nwnx.org

2015-02-27 01:24:34 : * Module hard link hook installed.
2015-02-27 01:24:34 : * Plugin initialized.
2015-02-27 01:24:40 : * Creating link at 'C:\Users\Mythy\AppData\Local\Temp\NWN2\CURRENTGAME.0\\ac_epee_geante_feu.UTI' to 'C:\Users\Mythy\Documents\Neverwinter Nights 2\modules\lyncya3_rm\ac_epee_geante_feu.UTI'.

_________________
NwN2 Action PW : http://www.lyncya.fr
NeverList : http://neverlist.nwn2.fr
Back to top
View user's profile Send private message Visit poster's website
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Mon May 25, 2015 19:32    Post subject: Reply with quote

With the plugin in use, hard links are created instead of files being copied. Your temp directory must be on the same volume as the module directory for this to work. You will still observe files being present in Explorer, but as they are links, they are much faster to create than a wholesale file copy as only directory entries are updated in the file system.
Back to top
View user's profile Send private message
Mythyzyn



Joined: 27 Feb 2015
Posts: 9

PostPosted: Thu May 28, 2015 9:45    Post subject: Reply with quote

Okay I better understand, thanks for your answer ! (and all your works)
_________________
NwN2 Action PW : http://www.lyncya.fr
NeverList : http://neverlist.nwn2.fr
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group