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

Windows CPU consumption varies

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,397
Solutions
17
Reaction score
148
Location
Brazil
Good afternoon people,

I have a 7.72 server (TFS 0.3.6, I know it's old but I can't upgrade) hosted on an AWS machine. Sometimes the CPU consumption goes up to 30, 60% (same number of players) and it is already felt like a crash in the game. Most of the time CPU consumption is at 0% or 3%. Is there a way for me to know what might be causing it? I have some custom MODs and Actions, some spells and Gesior on the same server. If you can help me with good practices to optimize the machine.

What information can I give on that would be relevant?
 
check your addEvents, onThink events and query executions mostly
onThink is practically in the NPC files.
Post automatically merged:

As evil mentioned, that's a good practice, you can try what's mentioned on this thread to see if you catch some issue that's causing some freezing: Here
Thanks man, i used the lib and appear this:

"possible infinite loop in file @data/npc/scripts/default.lua near line 5

and this is my /npc/scripts/default.lua

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

npcHandler:addModule(FocusModule:new())
 
Last edited:
onThink is practically in the NPC files.
Post automatically merged:


Thanks man, i used the lib and appear this:

"possible infinite loop in file @data/npc/scripts/default.lua near line 5

and this is my /npc/scripts/default.lua

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

npcHandler:addModule(FocusModule:new())
It's a false positive, it also states in the thread that it may occur during server startup. Just keep on using your server like you did, when your cpu usage spikes up try to look at the console to see if it catches something
 
It's a false positive, it also states in the thread that it may occur during server startup. Just keep on using your server like you did, when your cpu usage spikes up try to look at the console to see if it catches something
Ok, other thing appear:

possible infinite loop in file LuaInterface::loadBuffer near line 3

i cant find this file
 
Back
Top