• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Programmer Help To Solve issue

_Aion_

Nothing Else
Joined
Jan 19, 2010
Messages
400
Solutions
4
Reaction score
10
Location
Jequie,Bahia,Brazil
Hello.
My Server are using 110% of CPU and i want someone for help me solve this.
I pay for help, i need this and try all that have on this forum and another.
About my server:
MAP 50mb.
70-90 on "full" lag.
OTX 2.9 (last on github)
8.60

About my machine:
Ubuntu 14.04
Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz, 4 cores
8GB RAM
120GB
 
Last edited:
Are you sure this is an issue?

Please note that 'top' outputs % utilization 100% / core thus = 110% cpu utilization is actually 110/400 or out of 800 if you have hyperthreading.
(thus its actually using 25% cpu.)


If you experience lags in monster movements etc, it may be problem with power-saving features of the cpu. (monster movement lags are best way to detect if this is cpu issue.)
 
Are you sure this is an issue?

Please note that 'top' outputs % utilization 100% / core thus = 110% cpu utilization is actually 110/400 or out of 800 if you have hyperthreading.
(thus its actually using 25% cpu.)


If you experience lags in monster movements etc, it may be problem with power-saving features of the cpu. (monster movement lags are best way to detect if this is cpu issue.)
Yeah, I figured that out.
But I can not find the cause of the lag and I've deactivated "everything" and the lag still persists.
 
Check the nice value of the server application, and mysqld (If i remember correctly lower = more priority)
Check limits.d, and if possible set to unlimited or max allowed of your distro.

also disable power saving features
How to disable all power management in Ubuntu (for a server netbook)?

Then check your network performance, run a download/upload test to your closest location. Also check if some1 is doing a crappy wget dos on your website.
 
This is a native problem of otx2 I also had this, who has this source with this problem fixed want too much money, I am correcting mine, but first I will test if otx3 has the same problem if it does not have,i update my server.
 
I use a 4.0Ghz i7 processor and I can put 450 players online, after that my processor reaches more than 100% use.
 
i'm not sure where its specified, but it sounds like the application was not compiled to use all cores / maybe as x86 instead of x64.
Try otx3 and if its still there try looking for multithreading functions in the source. Its likely a problem there.
(when you have plenty of users think what module would be utilized most - and likely there's the bottleneck - you could also try trace run it but it will slow down the server a lot.)
 
This is a native problem of otx2 I also had this, who has this source with this problem fixed want too much money, I am correcting mine, but first I will test if otx3 has the same problem if it does not have,i update my server.
Do you have the "solution" for this in otx2?
I can not migrate to otx3, it's a dragon ball server.
i'm not sure where its specified, but it sounds like the application was not compiled to use all cores / maybe as x86 instead of x64.
Try otx3 and if its still there try looking for multithreading functions in the source. Its likely a problem there.
(when you have plenty of users think what module would be utilized most - and likely there's the bottleneck - you could also try trace run it but it will slow down the server a lot.)

Unfortunately I can not migrate :(
And I find nothing about multithreading
 
this may help;
Search · thread · GitHub
thought it may be easier to compile it from ms vs to trace the cpu bottleneck.

You should also submit a bug in github, and if they were aware of it & fixed it in otx3; the author will be able to help you with solution.
GitHub - mattyx14/otxserver: The OTX Server


but please do note, that some hosts use vm's and do not assign all resources to vm's - resources are in delegated state unless a call is made. (even tho it shows you all the resources - you don't have them.)
 
try to disable save or put a largar save interval
..... also you can test/check it disabling some globalevents /creatureescripts
maybe a custom scripts?
@_Aion_
 
It might be packet flooding issue(for some reason otx2 don't have protection) I have the same problem on dragon ball ots based on tfs 0.3.6(some botters using script that flooding server with packets).
However I don't know if this is the issue for you it's still good to have the anti-flood protection.


connection.cpp
in function:
Code:
void Connection::parseHeader(const boost::system::error_code& error)
before:
Code:
--m_pendingRead;
write:
Code:
    uint32_t timePassed = std::max<uint32_t>(1, (time(NULL) - m_timeConnected) + 1);
    if((++m_packetsSent / timePassed) > 75)
    {
        close();
        m_connectionLock.unlock();
        return;
    }

    if(timePassed > 2)
    {
        m_timeConnected = time(NULL);
        m_packetsSent = 0;
    }

connection.h
after:
Code:
m_protocol = NULL;
write:
Code:
    m_packetsSent = 0;
    m_timeConnected = time(NULL);
after:
Code:
bool m_receivedFirst, m_writeError, m_readError;
write:
Code:
    time_t timeConnected;
    uint32_t packetsSent;
 
try to disable save or put a largar save interval
..... also you can test/check it disabling some globalevents /creatureescripts
maybe a custom scripts?
@_Aion_
no problem in scripts, the problem is really in source, it does not work correctly with multi thread, it just pops the cpu in 1 thread because it only uses 1 for almost everything.


It might be packet flooding issue(for some reason otx2 don't have protection) I have the same problem on dragon ball ots based on tfs 0.3.6(some botters using script that flooding server with packets).
However I don't know if this is the issue for you it's still good to have the anti-flood protection.
Thanks a lot, it's not what we're talking about but I'm having a problem with flooding too, so what you've been through can help me, thank you.
 
It might be packet flooding issue(for some reason otx2 don't have protection) I have the same problem on dragon ball ots based on tfs 0.3.6(some botters using script that flooding server with packets).
However I don't know if this is the issue for you it's still good to have the anti-flood protection.


connection.cpp
in function:
Code:
void Connection::parseHeader(const boost::system::error_code& error)
before:
Code:
--m_pendingRead;
write:
Code:
    uint32_t timePassed = std::max<uint32_t>(1, (time(NULL) - m_timeConnected) + 1);
    if((++m_packetsSent / timePassed) > 75)
    {
        close();
        m_connectionLock.unlock();
        return;
    }

    if(timePassed > 2)
    {
        m_timeConnected = time(NULL);
        m_packetsSent = 0;
    }

connection.h
after:
Code:
m_protocol = NULL;
write:
Code:
    m_packetsSent = 0;
    m_timeConnected = time(NULL);
after:
Code:
bool m_receivedFirst, m_writeError, m_readError;
write:
Code:
    time_t timeConnected;
    uint32_t packetsSent;
I will try.
Thanks
Did you find a solution?
Not yet
 
It might be packet flooding issue(for some reason otx2 don't have protection) I have the same problem on dragon ball ots based on tfs 0.3.6(some botters using script that flooding server with packets).
However I don't know if this is the issue for you it's still good to have the anti-flood protection.


connection.cpp
in function:
Code:
void Connection::parseHeader(const boost::system::error_code& error)
before:
Code:
--m_pendingRead;
write:
Code:
    uint32_t timePassed = std::max<uint32_t>(1, (time(NULL) - m_timeConnected) + 1);
    if((++m_packetsSent / timePassed) > 75)
    {
        close();
        m_connectionLock.unlock();
        return;
    }

    if(timePassed > 2)
    {
        m_timeConnected = time(NULL);
        m_packetsSent = 0;
    }

connection.h
after:
Code:
m_protocol = NULL;
write:
Code:
    m_packetsSent = 0;
    m_timeConnected = time(NULL);
after:
Code:
bool m_receivedFirst, m_writeError, m_readError;
write:
Code:
    time_t timeConnected;
    uint32_t packetsSent;
No works, many errors when copile.
 
Back
Top