Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-06-2009, 02:00 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Insane CPU Usage

On Era Dev, we're constantly seeing things like this in our stats:

Quote:
Originally Posted by /stats
Top 10 of npcs taken most CPU time:
1. 14.767989811 percent -System/Commands (commands_items,commands_def,commands_staff)
This is absolutely ridiculous; there is no feasible way the script could be this CPU-intensive. The only command used was a single summon. This happens to virtually all of our scripts, from the simplest to the most complex. I don't notice any pattern or specific time this happens, but at some points the server is so laggy we can't do anything, even on RC with no scripts running. I have checked out the scripts with function profiling and all other tools we have, but there is no reason for this to be occurring.

This is clearly a problem with the server and not our scripts, and I'd like to hear from Stefan about what we can to to fix this. It is impossible to get any kind of clue how efficient our scripts are when they're constantly reaching 15percent on the CPU usage list for no reason.
__________________
Reply With Quote
  #2  
Old 08-06-2009, 02:11 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
If you already did function profiling on everything and analyzed /stats when the problem was happening, I imagine this would be a problem Stefan would have to take care of.

It's possible there is something else on the machine making iowait go up and therefore artificially boosting all the "CPU usage" percentages on the GServer.

It could also be one of your scripts doing too much I/O. Is your memory usage too high? Perhaps it's swapping.

There are a number of things that could be happening, but I guess it'll be tough to tell without someone with access to check these things coming.
Reply With Quote
  #3  
Old 08-06-2009, 02:21 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
RELEASE THE CPU EFFICIENCY TOOL!/caps
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #4  
Old 08-06-2009, 02:29 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by WhiteDragon View Post
If you already did function profiling on everything and analyzed /stats when the problem was happening, I imagine this would be a problem Stefan would have to take care of.

It's possible there is something else on the machine making iowait go up and therefore artificially boosting all the "CPU usage" percentages on the GServer.

It could also be one of your scripts doing too much I/O. Is your memory usage too high? Perhaps it's swapping.

There are a number of things that could be happening, but I guess it'll be tough to tell without someone with access to check these things coming.
We're using approximately 8 MB (8.1937561) of memory, so that's not the problem.

As far as I know, virtually all UC servers are on the same machine, so I wonder if that's the problem? Perhaps we could be transferred to whatever machine Era is on.
__________________
Reply With Quote
  #5  
Old 08-06-2009, 02:36 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
As far as I know, virtually all UC servers are on the same machine, so I wonder if that's the problem? Perhaps we could be transferred to whatever machine Era is on.
I think the best bet is that another machine is doing something intensive that makes your script wait on some resource and say that it's using more CPU than it actually is.
Reply With Quote
  #6  
Old 08-06-2009, 02:41 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by WhiteDragon View Post
I think the best bet is that another machine is doing something intensive that makes your script wait on some resource and say that it's using more CPU than it actually is.
I'm wondering if it has something to do with Stefan's backups as well. I know that has caused problems like this for servers in the past.
__________________
Reply With Quote
  #7  
Old 08-06-2009, 04:31 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
We get the same once a day on Maloria around 00.30-02.00 GMT+1, scripts containing basically no script at all start complaining about 20% CPU usage while the server itself lags unbearably much.

Every day, same time.
__________________
Follow my work on social media post-Graal:Updated august 2025.

Last edited by xXziroXx; 08-06-2009 at 05:21 PM..
Reply With Quote
  #8  
Old 08-06-2009, 04:48 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
You might want to show this to Crow, I think he once had the same problem with a script... nick-system?
Reply With Quote
  #9  
Old 08-06-2009, 05:16 PM
Cloven Cloven is offline
Delteria
Cloven's Avatar
Join Date: Dec 2006
Location: Florida, United States
Posts: 542
Cloven has a spectacular aura about
Send a message via AIM to Cloven
There's a massive lag issue at the same time daily on Delteria Dev as well. NC usually dies reliably at the same time along with it (or at the very least, does not work properly for a short period of time). In one instance I've actually had a script revert to an older version of itself without explanation. o_O
Reply With Quote
  #10  
Old 08-06-2009, 05:16 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Pelikano View Post
You might want to show this to Crow, I think he once had the same problem with a script... nick-system?
That was clientside lag, and it had to do with him using player attributes to display nick names .



Sounds to me like this is a common issue, and perhaps Stefan is spreading the machines too thin?
__________________
Reply With Quote
  #11  
Old 08-06-2009, 05:28 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Judging by what everyone is saying, it sounds like Stefan runs some sort of backup which somehow uses a resource (probably i/o) that makes all the GServers wait on stuff and artificially boosts their CPU usage.

I imagine something should be able to be done by it considering there is this sort of problem in any real-time system that requires backing up.
Reply With Quote
  #12  
Old 08-06-2009, 05:32 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by cbk1994 View Post
Sounds to me like this is a common issue, and perhaps Stefan is spreading the machines too thin?
And/or maybe a server is doing some lag-intensive script at that time.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #13  
Old 08-06-2009, 05:35 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Switch View Post
And/or maybe a server is doing some lag-intensive script at that time.
Well, besides the fact that there is no such thing as a "lag-intensive" script, I think you'd be hard pressed to make a script capable of pretty much crashing every single server on the machine you're on.
__________________
Reply With Quote
  #14  
Old 08-06-2009, 05:41 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by cbk1994 View Post
That was clientside lag, and it had to do with him using player attributes to display nick names .
This.

I'm thinking as well that the issue is related to the machine Era Dev is on.
Reply With Quote
  #15  
Old 08-06-2009, 06:42 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Switch View Post
And/or maybe a server is doing some lag-intensive script at that time.
Unlikely, since it happens every day at the same time.

Quote:
Originally Posted by cbk1994 View Post
Well, besides the fact that there is no such thing as a "lag-intensive" script, I think you'd be hard pressed to make a script capable of pretty much crashing every single server on the machine you're on.
... I did it once.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.