Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-12-2009, 05:55 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

You could check the configuration for mysql, or do some diagnostics on the queries being used. How many threads is mysql set up to use? Could be a thrashing problem, but who knows without a bit more looking.
Reply With Quote
  #2  
Old 07-12-2009, 06:16 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Is this for SoA? Just curious, because I got a PM on my forums about a similar issue with them, and I don't want to work the same issue from here and through PM at the same time.

What revision of source is the server running? A while back, there was a few versions put up that had a particularly nasty loop in the code that was driving CPU utilization way up. Also, have you tried checking the logs to see if this might be something related to a quest script gone wrong?

Check the following function in Hatelist.cpp and verify that the iterator.Advance(); in red is in your source:

Code:
Mob *HateList::GetTop(Mob *center)
{
        _ZP(HateList_GetTop);
        Mob* top = NULL;
        sint32 hate = -1;
        
        if (RuleB(Aggro,SmartAggroList)){
                Mob* topClientInRange = NULL;
                sint32 hateClientInRange = -1;
                LinkedListIterator<tHateEntry*> iterator(list);
                iterator.Reset();
                while(iterator.MoreElements())
                {
                tHateEntry *cur = iterator.GetData();
                        sint16 aggroMod = 0;

                        if(!cur){
                                iterator.Advance();
                                continue;
                        }                       

                        if(!cur->ent){
                                iterator.Advance();
                                continue;
                        }

                        if(cur->ent->DivineAura() || cur->ent->IsMezzed()){
                                if(hate == -1)
                                {
                                        top = cur->ent;
                                        hate = 0;
                                }
                                iterator.Advance();
                                continue;
                        }

                        sint32 currentHate = cur->hate;

                        if(cur->ent->IsClient()){
                                
                                if(cur->ent->CastToClient()->IsSitting()){
                                        aggroMod += RuleI(Aggro, SittingAggroMod);
                                }

                                if(center){
                                        if(center->GetTarget() == cur->ent)
                                                aggroMod += RuleI(Aggro, CurrentTargetAggroMod);
                                        if(RuleI(Aggro, MeleeRangeAggroMod) != 0)
                                        {
                                                if(center->CombatRange(cur->ent)){
                                                        aggroMod += RuleI(Aggro, MeleeRangeAggroMod);

                                                        if(currentHate > hateClientInRange || cur->bFrenzy){
                                                                hateClientInRange = currentHate;
                                                                topClientInRange = cur->ent;
                                                        }
                                                }
                                        }
                                }

                        }
                        else{
                                if(center){
                                        if(center->GetTarget() == cur->ent)
                                                aggroMod += RuleI(Aggro, CurrentTargetAggroMod);
                                        if(RuleI(Aggro, MeleeRangeAggroMod) != 0)
                                        {
                                                if(center->CombatRange(cur->ent)){
                                                        aggroMod += RuleI(Aggro, MeleeRangeAggroMod);
                                                }
                                        }
                                }
                        }

                        if(cur->ent->GetMaxHP() != 0 && ((cur->ent->GetHP()*100/cur->ent->GetMaxHP()) < 20)){
                                aggroMod += RuleI(Aggro, CriticallyWoundedAggroMod);
                        }

                        if(aggroMod){
                                currentHate += (currentHate * aggroMod / 100);
                        }

                        if(currentHate > hate || cur->bFrenzy){
                                hate = currentHate;
                                top = cur->ent;
                        }

                        iterator.Advance();
                }

                if(topClientInRange != NULL && top != NULL && !top->IsClient())
                        return topClientInRange;
                else
                        return top;
        }
        else{
                LinkedListIterator<tHateEntry*> iterator(list);
                iterator.Reset();
                while(iterator.MoreElements())
                {
                tHateEntry *cur = iterator.GetData();
                        if(cur->ent != NULL && ((cur->hate > hate) || cur->bFrenzy ))
                        {
                                top = cur->ent;
                                hate = cur->hate;
                        }
                        iterator.Advance();
                }
                return top;
        }
}
This was fixed in R472, and was introduced in R458. So, if your server is running code between those 2 revisions, either try updating and see if it fixes it, or simple adding the iterator as shown in red above should fix it.

I am not aware of any other bugs causing high CPU utilization recently.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 -4. The time now is 07:01 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3