server using a lot of CPU
# support-forum
c
my server is using a lot of CPU, each player online is using 2% of CPU... there is a lib to show the heavy functions that's eating my CPU?
g
c
i just put the plugin on plugin folder, set server.cfg, starts the server and then what gonna happen?
@gentle-london-6993 i did download the plugin from: https://github.com/Zeex/samp-plugin-profiler/releases/tag/v2.15.3 put the plugin
profiler.so
on folder
/plugins
change the
server.cfg
lines
Copy code
plugins crashdetect.so mysql.so sscanf.so streamer.so sampvoice.so profiler.so
and then added at the end a line
profiler_gamemodes TDM
because there is a TDM.amx in gamemodes folder that i want to check but i didn't notice any change, what should happen now? where could i check the changes?
b
It will a generate a file
c
when the server shutdowns or something? because yesterday i didnt found this file, but today it is on /gamemodes
TDM-profile.html
could you give me advices about how to read this file? where and how should i look? Total Time Average: 43.1 Worst: 169.9 its telling me that the function used 43% of my whole CPU (all threads) and in the worst scenario it uses 169.9 of my whole cpus (all threads) ???
b
Which function?
s
how many is your cpu cores and threads?
what's the peak of your server player base?
c
a random function
b
What?
random()
?
c
8 cores
what are threads? how can i see and how it impact?
50~100
no i mean, a pick a random function on the list just to understand how to read it
idk what is this
Self Time
,
Total Time
idk how to search the problems with the info the plugin gives me
b
Idk. But you can sort the list to see which thing takes the most resources
s
whats the cpu usage with that 100 players?
c
idk but with 60 players it uses 75%
why did u ask about threads, what should i know about that?
s
cause i once had an issue with my cpu usage went to 100%, but i was using 2 cores cpu. upgrading it to 4 cores went smooth
have you tried it in your local computer? is the result same?
c
idk i just buyed a samp server service, i dont have terminal acess i dont understand how threads works on CPU they told us we can use 200% of CPU with no problems, but i dont get why
idk how should i test it, to incriese cpu i should have players online
s
then it should be okay, 75% doesnt even reach a half of 200%. at least it doesnt lag your server, so you shouldnt worry
c
they said with the same machine others servers manage to have 300-400 players on
i have to make my server lighter if i want to get more players
thats why i want to understand how to use this profiler plugin
i wanna know how to get problematic functions i would like to understand what is this
Self Time
,
Total Time
s
i dont use profiler plugin, so i cant say much about it. latest crashdetect (yless one) would do the same ig, it detects your 'laggy' functions/callbacks
if your limit is 200% of cpu usage, then 75% is like only 30-40% to 100%. you shouldn't worry about it, it also doesnt lag your server. but if you do or it does, then you could do the optimizations like you're wanting to do. crashdetect has something called long callback detection, it detects callbacks that's being executed longer than the normal/specified time https://github.com/Y-Less/samp-plugin-crashdetect
3 Views