CPU Usage -
CONTROLA - 02.02.2013
I've noticed my CPU usage is pretty high so I started using the profiler plugin and saw these things:
Are these critical? If yes, what's the 'unknown@0x000001f4' ?
Please help!
Re: CPU Usage -
CONTROLA - 02.02.2013
BoomBoxTimer - 1000ms global timer
CustomPickups - 1000ms global timer
Sorry for the double post! (internet problem)
By the way, these are the plugins I use(in server.cfg order): MySQL R7, Incognito's Streamer, Profiler
Re: CPU Usage -
CONTROLA - 02.02.2013
How can I do this? Can you tell me, please?
Re: CPU Usage -
Babul - 02.02.2013
assuming you are using pawno, goto menu "Build" > "Run Options" and look at the 3rd string (last one) - if you didnt touch it yet, its "-r". to add the "-d2" or "-d3" option, simply type it into the box.
to validate, heres how i think your compile options should be setup now: "-r -d3"
maybe its of interest: thats the place where to add the -S<value> for increasing the heap/stack size. due to adding "-S65536", a stack overflow doesnt occur anymore.
Re: CPU Usage -
CONTROLA - 02.02.2013
-r -w -d3 203 <- These are my current compiler options now. I compiled it and set it up on the host. How can I get the real symbol idea now?
Re: CPU Usage -
Babul - 02.02.2013
the profiler is not really meant to be used in a public server - it needs a lot of resources.
the best, and quickest way is to add the profiler in your (local) server.cfg, let it profile the gamemode + relevant filterscripts, and let it run for some time.
if any function proves to be cpu-hungry, it will show in the profile output.
oh, i forgot to mention that you need to recompile all scripts, in order to get the symbolic information (like callback names/addresses etc) being written into the .amx file.
its a good idea to start profiling the gamemode only, then add the filterscripts.
edit: heres a short run of my gamemode:
Код:
Type Name Calls Self Time Total Time
public OnGameModeInit 1 18.91 18.91
public main 1 0.00 0.00
public TimerServicesM 69 0.27 0.27
public ZoneXYTimer 70 3.61 3.61
public TimerServices4 1335 2.05 2.05
public ScrollTimer 690 64.89 64.89
public ZoneTimer 46 2.19 2.19
public TimerLotto 66 0.40 0.40
public TimerSync 90 0.43 0.43
public TimerServices3 140 1.17 1.17
public TimerServices2 35 6.05 6.05
public LevelDecreaseTimer 2 0.00 0.00
public TimerServices1 1 0.00 0.00
public OnGameModeExit 1 0.01 0.01
as you can see, my "ScrollTimer" seems to eat a lot of cpu - its one relict i wanted to get rid off, and never optimized it... the "total time" proves it ><
Re: CPU Usage -
CONTROLA - 02.02.2013
I'm not using any filterscript. I've recompiled the gamemode & npcmodes .pwn files.
Where is the symbolic information supposed to be printed?
Re: CPU Usage -
Babul - 03.02.2013
the -debug information gets written into the executable .amx file.
the virtual machine which runs the gamemode, wont get any advantage of that, but by using f.ex the crash detect plugin, or here: the profiler plugin, its easy to get the function names, not just their offset in memory (like the address 0x000001f4).
hence that as soon you know the functions name, you know where to start editing the script - at the moment its hard to guess which callback causes the high cpu usage, but i assume it could be the OnPlayerUpdate()..
Re: CPU Usage -
CONTROLA - 03.02.2013
I've compiled all the scripts and had my server running for about 5 minutes. I still have a lot of unknown@code functions in the function list, from which some are called more than 10000 times and their total time is bigger than 1.00. I've optimised three functions which had high total time but I still can't know what the 'unknown@0x000001f4' is.
By the way, I'm not using OnPlayerUpdate.