View previous topic :: View next topic |
Author |
Message |
Sir Elric
Joined: 19 Apr 2005 Posts: 16 Location: Australia
|
Posted: Tue Apr 26, 2005 1:49 Post subject: nwnserver.exe hangs CPU at 100% |
|
|
My server from time to time crashes but the nwn process is still running so NWNX2 doesn't autoload it as it thinks it's still running.
Is there any setting to combat this?
Do other PW owners ever experience this type of crash?
TIA
SE _________________ City of Melnibone - PW
ausnwn.dyndns.org:5121 |
|
Back to top |
|
|
Lokey
Joined: 02 Jan 2005 Posts: 158
|
Posted: Tue Apr 26, 2005 11:03 Post subject: |
|
|
Tried the WatchdogGamespy settings? _________________ Neversummer PW NWNx powered mayhem |
|
Back to top |
|
|
Senalaya
Joined: 29 Dec 2004 Posts: 82 Location: Germany
|
Posted: Tue Apr 26, 2005 12:52 Post subject: |
|
|
The gamespy watchdog should definitly detect that. It works fine here.
Other than that, you might want to check your scripting. The most common reasons for the 100% CPU hangup are endless loops from broken GetFirst/GetNext browsing. A good method to prevent this is adding a 'sanity' counter:
int nCounter = 0;
object oObject = GetFirstxxx();
while (GetIsObjectValid(oObject) && (nCounter <= N)
{
...
oObject = GetNextxxx();
nCounter++;
}
Replace 'N' with a useful limit. i.e. when you browse the current players (GetFirst/NextPC), the limit should be the max player setting of your server. |
|
Back to top |
|
|
Sir Elric
Joined: 19 Apr 2005 Posts: 16 Location: Australia
|
Posted: Tue Apr 26, 2005 13:28 Post subject: |
|
|
Senalaya wrote: | The gamespy watchdog should definitly detect that. It works fine here.
Other than that, you might want to check your scripting. The most common reasons for the 100% CPU hangup are endless loops from broken GetFirst/GetNext browsing. A good method to prevent this is adding a 'sanity' counter:
int nCounter = 0;
object oObject = GetFirstxxx();
while (GetIsObjectValid(oObject) && (nCounter <= N)
{
...
oObject = GetNextxxx();
nCounter++;
}
Replace 'N' with a useful limit. i.e. when you browse the current players (GetFirst/NextPC), the limit should be the max player setting of your server. |
Thanks the counter idea looks like a good safety net.
Fairly new to NWNX2 how will the gamespy watchdog help this situation?
TIA
SE _________________ City of Melnibone - PW
ausnwn.dyndns.org:5121 |
|
Back to top |
|
|
Senalaya
Joined: 29 Dec 2004 Posts: 82 Location: Germany
|
Posted: Tue Apr 26, 2005 13:31 Post subject: |
|
|
The GameSpy watchdog tries to access the nwserver.exe with a TCP/IP communication on the gameport (5121 in most cases) every x seconds (gamespy interval). If the nwserver.exe doesn't respond to that y times (gamespy retries), NWNX kills the server process and restarts it. In case of a 100% CPU hangup, NWN will fail to respond. |
|
Back to top |
|
|
Sir Elric
Joined: 19 Apr 2005 Posts: 16 Location: Australia
|
Posted: Tue Apr 26, 2005 17:15 Post subject: |
|
|
Ah many thanks will give this a go.
Seem to be getting more and more of these types of crashes of late looks like it's time to wade back through all the core code
SE _________________ City of Melnibone - PW
ausnwn.dyndns.org:5121 |
|
Back to top |
|
|
Sir Elric
Joined: 19 Apr 2005 Posts: 16 Location: Australia
|
Posted: Wed Apr 27, 2005 1:23 Post subject: |
|
|
Also will the GameSpyWatchDog still work even if you don't post the game to the internet via gameSpy?
And will it kill the process that is currently hung before restarting?
TIA
SE _________________ City of Melnibone - PW
ausnwn.dyndns.org:5121 |
|
Back to top |
|
|
Senalaya
Joined: 29 Dec 2004 Posts: 82 Location: Germany
|
Posted: Wed Apr 27, 2005 10:44 Post subject: |
|
|
As stated before, yes the hung up process will be killed/terminated.
The name 'GameSpy' watchdog might be a bit misleading. The mechanism runs local, completely independent from the official GameSpy server. So, it works whether or not the game posts on the internet. |
|
Back to top |
|
|
Sir Elric
Joined: 19 Apr 2005 Posts: 16 Location: Australia
|
Posted: Wed Apr 27, 2005 12:37 Post subject: |
|
|
Well I tried this on a test server and initiated a crash and have had mixed results.
1st time server hung and nothing happened.
2nd time server hung and was restarted.
3rd time server hung and got a port still in use error.
4th time server hung and got a port still in use error.
SE _________________ City of Melnibone - PW
ausnwn.dyndns.org:5121 |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Fri Apr 29, 2005 19:06 Post subject: |
|
|
1) As far as I know, nwserver needs to be set to "post to internet" in order for the gamespy type watchdog to work. Otherwise, NWN will not answer the polls NWNX sends.
2) If you get a "port in use" error, set the "restartdelay" parameter in the ini file (or on the command line) to something like 60 seconds.
3) We get these 100% lockups on Avlis from time to time on certain modules, while others do not have this problem. I doubt you can create a script that hangs the server (because of the TMI Too Many Instructions check), but there may be circumstances that lead to an endless loop in the core code of the server. My advise would be to NOT check the scripts for endless loops, this seems just unlikely. _________________ Papillon |
|
Back to top |
|
|
Sir Elric
Joined: 19 Apr 2005 Posts: 16 Location: Australia
|
Posted: Sat Apr 30, 2005 2:28 Post subject: |
|
|
Papillon wrote: | 1) As far as I know, nwserver needs to be set to "post to internet" in order for the gamespy type watchdog to work. Otherwise, NWN will not answer the polls NWNX sends.
2) If you get a "port in use" error, set the "restartdelay" parameter in the ini file (or on the command line) to something like 60 seconds.
3) We get these 100% lockups on Avlis from time to time on certain modules, while others do not have this problem. I doubt you can create a script that hangs the server (because of the TMI Too Many Instructions check), but there may be circumstances that lead to an endless loop in the core code of the server. My advise would be to NOT check the scripts for endless loops, this seems just unlikely. |
We managed to hang the server just by hitting the quick save as DM.
I ran the profiler and narrowed it down to the nw_c2_default1(hb) script.
I had small piece of code that Force Rested the mob after a set amount of time using a delay and a local int(I use all placed mobs in my PW btw).
I removed this and now hitting quick save does not hang the server, not too sure how these are related or if this will stop the "normal" server hangs we have been having but so far so good we haven't had a hang since.
The other thing was with XP/PRO when the server hangs you get a pop up message saying "program not responding" and until this is closed the port will remain open.
If you turn this setting off then all is good.
SE _________________ City of Melnibone - PW
ausnwn.dyndns.org:5121 |
|
Back to top |
|
|
|