Page 1 of 5

Killing CPU

Posted: Wed Jun 24, 2009 12:12 pm
by Pere
Hi!

My server, once has a few hours online, begins to lag like hell, on intervals for everything.
Last time I've took a look in CPU manager, and it was funny: 100%-30%-100%-25%-100%-50% drawing waves in the manager, huge waves :mrgreen:
I think that it can be a threadpool problem.. there is my config:

Code: Select all

#============================================================##                   Thread Configuration                     ##============================================================## Extreme caution should be here, set to defaults if you do# not know what you are doing.# These could possibly hurt your servers performance, or improve # it drastically. ThreadPoolSizeEffects = 25ThreadPoolSizeGeneral = 32 #Default 2UrgentPacketThreadCoreSize = 5#Default 4GeneralPacketThreadCoreSize = 10#Default 4GeneralThreadCoreSize = 10 AiMaxThread = 10 #Packet LifeTime in milliseconds, 0 - disabled featurePacketLifeTime = 0 #Dead Lock Detector (a separate thread for detecting deadlocks)#For improved crash logs and automatic restart in deadlock case if enabled#Check interval is in secondsDeadLockDetector = FalseDeadLockCheckInterval = 20RestartOnDeadlock = False 
This cannot be detected as deadlock, true?
My CPU is a Xeon quad with 2.6 GHZ and 8GB RAM DDR2..
Sometimes the server crashes due to out of memory errors to.. so there is double problem ;S

And about my events, their tasks are threaded as general, they are a lot similar to FBIAgent's TvT (and the lag is the same when there isn't event).
I have more customizations, but they are things like creaturesays, announcements.. not bucles or lists ;S

Re: Killing CPU

Posted: Wed Jun 24, 2009 12:29 pm
by _DS_
Use "debug full" from telnet and analyse active threads.

Re: Killing CPU

Posted: Wed Jun 24, 2009 12:56 pm
by Pere
Ok, now I have to wait a restart to enable telnet and then to wait for the lag -_-

Thank you

Re: Killing CPU

Posted: Wed Jun 24, 2009 1:30 pm
by Pere
Lol, only 10 minutes to do this!! :S

There is the debug: http://94.23.16.191/debug-0.txt

Thank you..

Re: Killing CPU

Posted: Wed Jun 24, 2009 1:49 pm
by _DS_
You have mysql bottleneck. Maybe mysql server heavily loaded from site ?

Re: Killing CPU

Posted: Wed Jun 24, 2009 1:59 pm
by Pere
Sure that is this?
http://94.23.16.191/debug-1.txt this is from 4-minutes onlinetime, 1% CPU usage

How could I avoid this problem? u.U My site needs access to all the dbs... and it also needs all the dbs in 1 host.

Thank you again, you are helping so much!!!

Re: Killing CPU

Posted: Wed Jun 24, 2009 2:16 pm
by _DS_
I recommend temporarily shutdown site during lags and see if it helps. Maybe you will need to rewrite scripts, add cache or smth like this.

Re: Killing CPU

Posted: Wed Jun 24, 2009 3:39 pm
by Pere
The mysql cache is 4GB in a dedicated host u.u

Re: Killing CPU

Posted: Wed Jun 24, 2009 3:45 pm
by Vapulabe
4Gb cache... Maybe a little excessive...
You've to analyse the requests done to the server. Usually, 10% of the request make 90% of the request volume... If these requests ask for very different data, cache is useless (memory waste). If they are mostly requesting the same data, you need to see the volume of that data, no need to set up the cache much higher.

For example, if most of the load comes from News page request and the news table is 1Mb, no need to have 1Gb cache...

Re: Killing CPU

Posted: Wed Jun 24, 2009 3:50 pm
by Saso
in NPC.properties check if this is defined like this:

Code: Select all

# Maximum distance mobs can randomly go from spawn point.# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT# Default: 300MaxDriftRange = 0
Same thing happened to me a while back, I busted my ass looking for packet overflooding, or stuff with mysql, wasn't it.

Good Luck

Re: Killing CPU

Posted: Wed Jun 24, 2009 4:12 pm
by kain
It has begun after updating before last audit. The server works 15 - 30 minutes. Then java it is loaded CPU on 90-100 %. On MySQL only a server lineage

DP - 6321
CORE - 3228

Re: Killing CPU

Posted: Wed Jun 24, 2009 5:14 pm
by Saso
Saso wrote:in NPC.properties check if this is defined like this:

Code: Select all

# Maximum distance mobs can randomly go from spawn point.# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT# Default: 300MaxDriftRange = 0
Same thing happened to me a while back, I busted my ass looking for packet overflooding, or stuff with mysql, wasn't it.

Good Luck
...

Re: Killing CPU

Posted: Wed Jun 24, 2009 5:15 pm
by Pere
LOL, it was the code!! I had the bugged MoS AI -_-
Infinite bucles killing my poor cpu....

Now fixed, I've updated again ^^

Re: Killing CPU

Posted: Thu Jun 25, 2009 10:05 am
by _DS_
Yes, but on the debug dumps no ai loops :)

Re: Killing CPU

Posted: Thu Jun 25, 2009 11:04 am
by Pere
It is the strange question, so I've only updated to the last revision and the CPU went back to 0-5% as ever T_T