Killing CPU

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Killing CPU

Post 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
Bones tardes amics meus tots!
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Killing CPU

Post by _DS_ »

Use "debug full" from telnet and analyse active threads.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Killing CPU

Post by Pere »

Ok, now I have to wait a restart to enable telnet and then to wait for the lag -_-

Thank you
Bones tardes amics meus tots!
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Killing CPU

Post by Pere »

Lol, only 10 minutes to do this!! :S

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

Thank you..
Bones tardes amics meus tots!
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Killing CPU

Post by _DS_ »

You have mysql bottleneck. Maybe mysql server heavily loaded from site ?
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Killing CPU

Post 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!!!
Bones tardes amics meus tots!
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Killing CPU

Post 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.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Killing CPU

Post by Pere »

The mysql cache is 4GB in a dedicated host u.u
Bones tardes amics meus tots!
Vapulabe
Posts: 271
Joined: Wed Mar 19, 2008 10:16 am

Re: Killing CPU

Post 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...
Saso
Posts: 55
Joined: Fri Apr 24, 2009 11:53 am

Re: Killing CPU

Post 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
kain
Posts: 11
Joined: Sun Feb 24, 2008 10:59 pm
Contact:

Re: Killing CPU

Post 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
Saso
Posts: 55
Joined: Fri Apr 24, 2009 11:53 am

Re: Killing CPU

Post 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
...
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Killing CPU

Post 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 ^^
Bones tardes amics meus tots!
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Killing CPU

Post by _DS_ »

Yes, but on the debug dumps no ai loops :)
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Killing CPU

Post 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
Bones tardes amics meus tots!
Post Reply