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 
 
Strange issues when doing several aps calls in a row

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
dray



Joined: 09 Feb 2005
Posts: 4

PostPosted: Wed Feb 09, 2005 1:36    Post subject: Strange issues when doing several aps calls in a row Reply with quote

Hi

I just ported parts of our pw world to aps and noticed some strange behavior when doing several calls in a row.

[snip]
SetPersistentInt(oPC,"ND_JAILED",1);
SetPersistentInt(oPC,"ND_JAILED_ROUNDS",iJailTime);
SetPersistentString(oPC,"ND_JAILED_REASON",Reason);
[/snip]

The first approach results in the last variable not beeing added to the db.
The insert does not appear in the debug log either.

[snip]
DelayCommand(0.5,SetPersistentInt(oPC,"ND_JAILED",1));
DelayCommand(1.5,SetPersistentInt(oPC,"ND_JAILED_ROUNDS",iJailTime));
DelayCommand(2.0,SetPersistentString(oPC,"ND_JAILED_REASON",Reason));
[/snip]

This approach with DelayCommand works as expected....

I have several similar issues like this and had to revert to the previous version of the module until I get this sorted.

The module is rather big, 75MB and is running on a AMD Opteron 2.2GHz system running FreeBSD 4.10 and MySQL 4.1.9

We've had no problems so far and cpu load is around 60% when fully crowded (40 players)

Any ideas?
Back to top
View user's profile Send private message
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Thu Feb 10, 2005 10:19    Post subject: Reply with quote

<-- Jealous. Opteron...

Maybe a too many instructions error through NWScript when you run all the commands in the same instance? You'd get feedback on that though.

Make sure there are no other changes between your script that works (delayed commands) and the one that doesn't first off. Also make sure that you're not trying to store a longer string than the database column is configured for...assume it's ok because you can get it to work in the latter case.

I do MySQL queries directly, so I'm not familiar with the other APS functions. With a larger module and a lot of players, you may want to think about doing as much with your database queries as you can such as set all those values with one SQL statement instead of 3.
_________________
Neversummer PW NWNx powered mayhem Wink
Back to top
View user's profile Send private message
dray



Joined: 09 Feb 2005
Posts: 4

PostPosted: Thu Feb 10, 2005 18:36    Post subject: Reply with quote

No "too many instructions" errors at all.

And there are no other changes between the working and working version.
This was just and example, as it mailfunctioned every single time.

There are otherplaces where the aps calls are not in a stright sequence like this example but divided over different scripts.

One example I've seen is players dying and ressurection never get playerstate changed back to normal, even if its the exact same function call that set their player state in the db to "dead".

There is no error and all the aps calls do inded fire, but the query is never ever run. It just seem to dissapear into eternity if there are too short of a break between the calls.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Thu Feb 10, 2005 20:10    Post subject: Reply with quote

Alas, I can not comment on this, since I currently have no way of running the linux version. Hopefully some Linux guy will be able to help.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Thu Feb 10, 2005 20:30    Post subject: Reply with quote

Well, don't say anything then! Wink

I will have a look and see how that works on my linux server.
Back to top
View user's profile Send private message Visit poster's website
dray



Joined: 09 Feb 2005
Posts: 4

PostPosted: Thu Feb 10, 2005 20:44    Post subject: Reply with quote

As this thing is a Dual Opteron SMP system running in 32bit mode with FreeBSD 5.3 I was thinking the SMP kernel might be causing troubles.

Makes no sense I know, but things isn't always that logical and I've seen strange SMP behavior before.

I tried running it on a FreeBSD 4.10 system running on a standard AMD 3200+ and got the same behavior.

I do not have a true Linux system available so I cannot say if FreeBSD itself might be the cause of the trouble. What I can say is that I've run Linux apps on FreeBSD for many many years now and never had any trouble at all.
Back to top
View user's profile Send private message
Erik O'Siodhachain



Joined: 25 Jan 2005
Posts: 3

PostPosted: Thu Feb 10, 2005 20:55    Post subject: Reply with quote

dray wrote:
As this thing is a Dual Opteron SMP system running in 32bit mode with FreeBSD 5.3 I was thinking the SMP kernel might be causing troubles.

Makes no sense I know, but things isn't always that logical and I've seen strange SMP behavior before.

I tried running it on a FreeBSD 4.10 system running on a standard AMD 3200+ and got the same behavior.

I do not have a true Linux system available so I cannot say if FreeBSD itself might be the cause of the trouble. What I can say is that I've run Linux apps on FreeBSD for many many years now and never had any trouble at all.


I'm working on the 2.6.4 new features port to Linux. Our test and live servers are both Dual processor. I have never seen this, but I will first have to search our code for a similar situation... then second... run an experiment if required.

Any other itmes of note? Large module? lot's of areas? MySQL on the same server? multiple nwserver instances running? just thinking out loud.
_________________
Smith & Wesson — the original point and click interface.

-- Unknown
Back to top
View user's profile Send private message
dray



Joined: 09 Feb 2005
Posts: 4

PostPosted: Thu Feb 10, 2005 23:13    Post subject: Reply with quote

Module is very large by my measures, 75MB

Quite a lot of areas yet, not sure on the exact count, but around 450 maybe including interiors.

MySQL runs on the same server and there are only one nwserver running.

As said, the load on the cpu running the script engine is around 50 - 60% when server is fully populated.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support 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