• 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!

Cpu High %

wesleyt10

Well-Known Member
Joined
Dec 15, 2012
Messages
73
Reaction score
71
hello everyone, i have been watching my otx recently and strangely it is consuming the cpu way too much, with 246 players online it consumed 90% of the cpu media, so i removed all the bodies that were not disappearing, i reduced the time they stay in the chao, I expected to decrease consumption, but when I restarted the server, with 150 online the CPU went up to 100-120%, it didn't cause lag or freeze, but the CPU was high! I removed all the systems, left the server raw, and nothing changed, I added an exhaustion system in the potions different from the timeExActions that is in the Lua config, so as not to disturb the pvp etc., I suspected that it was the case, but it did not change consumption, test was done by the command top in linux, but with 1 player online, the server consumes 3% cpu on average, only 1 player, performing normal functions, using potion, attacking, healing, using item, spells, the stopped character consumes between 1.7% and 2.3% cpu! ALL otx distros I tested are with the same media. removed all craturescript, all globalevents, all moveeevents, actions, etc. and nothing has changed consumption! help me.

I can't say if the controller only showed the peaks, but all variations were above 100% of use.
 
A gigantic portion of CPU usage comes from the path matching function in sources. If you're really trying to figure it out, use perf since you're running Linux, and you'll be able to figure out what functions are causing the most usage in sources, but I guarantee the top performance-hitting function will be Map::getPathMatching.
If the CPU usage is really that large of an issue, there are only really 2 things to do, upgrade your server (host) to better specs, or attempt to optimize performance intensive functions.
 
A gigantic portion of CPU usage comes from the path matching function in sources. If you're really trying to figure it out, use perf since you're running Linux, and you'll be able to figure out what functions are causing the most usage in sources, but I guarantee the top performance-hitting function will be Map::getPathMatching.
If the CPU usage is really that large of an issue, there are only really 2 things to do, upgrade your server (host) to better specs, or attempt to optimize performance intensive functions.

would this perf be a package to install? like htop? but being one that demonstrates the functions of the distro? if so, could you make me a little tutorial to understand?
 
reviewing the perf command I noticed that what causes the biggest consumption of otx is the function Map :: getSpectatorsInternal (SpectatorVec & list, const Position & centerPos, int32_t minRangeX, int32_t maxRangeX, int32_t minRangeY, int32_t maxRangeY, int32_t minRangeZ, int32_t maxRangeZ, int32_t maxRoolZ, int32_t maxRoolZ but I have no idea what it is and how to fix it, someone who already has this kind of problem can help I am grateful!
 
I don't think you can optimize getSpectators further.
It's just a resource intensive function because of what its doing (gets all creatures in an area).

You'll have to look at other functions.
Tbh you have no chance at optimizing CPU usage based on these questions, you'd need some heavy c++ knowledge.
 
I don't think you can optimize getSpectators further.
It's just a resource intensive function because of what its doing (gets all creatures in an area).

You'll have to look at other functions.
Tbh you have no chance at optimizing CPU usage based on these questions, you'd need some heavy c++ knowledge.

but I'm here just to appeal to those who have such knowledge, and apparently I believe that I am not the only one who goes through this problem if this is common in otx sources
 
Back
Top