SA-MP Forums Archive
server process difficult... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: server process difficult... (/showthread.php?tid=618615)



server process difficult... - Spenker - 08.10.2016

When my server server exceeds 180 players begin to process difficult. (180+ players on‌line = server lag)
I do not understand why...

My GameMode:
Runs 3 GlobalTimers. (1 = 600ms | 2 = 1 seconds | 3 = 4 minutes)
Use ZCMD + MYSQL R39.
Код HTML:
public OnPlayerUpdate(playerid)
{
    playerInfo[playerid][AFKTime] = 0;
    return 1; 
}



Re: server process difficult... - Spenker - 08.10.2016

anyone?


Re: server process difficult... - Luicy. - 08.10.2016

Probably weak host.


Re: server process difficult... - Spenker - 08.10.2016

Not, host is ok.


Re: server process difficult... - Vince - 08.10.2016

Run profiler plugin. The amount of timers in itself tells nothing. Twenty timers with 5 lines of code will still be faster than 3 timers with 200 lines of code. One tip is to use prime numbers for the timer intervals so the amount of conflicts are reduced to a minimum; every 3 seconds the 600ms and the 1s timer will converge and execute at the exact same time.


Re: server process difficult... - Spenker - 08.10.2016

Quote:
Originally Posted by Vince
Посмотреть сообщение
Run profiler plugin. The amount of timers in itself tells nothing. Twenty timers with 5 lines of code will still be faster than 3 timers with 200 lines of code. One tip is to use prime numbers for the timer intervals so the amount of conflicts are reduced to a minimum; every 3 seconds the 600ms and the 1s timer will converge and execute at the exact same time.
Thank you.
Is ok?
Код HTML:
SetTimer("SpeedometerUpdate", 600, 1);
SetTimer("gTimer", 1040, 1);