Avoiding server lag - 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: Avoiding server lag (
/showthread.php?tid=562812)
Avoiding server lag -
FunnyBear - 11.02.2015
Hey,
I recently started to rescript my server because of server lag. I updated from MySQL R5 to MySQL R33. Is there a way to reduce or avoid server lag completely, and make it run smoothly. The Login/Register/Admin system will be included within the gamemode, not as a filterscript. I don't want to continue without knowing if there is any way I can avoid lag in the future.
Thanks
Re: Avoiding server lag -
Misiur - 11.02.2015
With change from R5 to R33 (R39 is the latest just FYI) did you change your all queries from unthreaded to threaded? If not, do it, otherwise you will still experience lag with every query.
Re: Avoiding server lag -
FunnyBear - 11.02.2015
Quote:
Originally Posted by Misiur
With change from R5 to R33 (R39 is the latest just FYI) did you change your all queries from unthreaded to threaded? If not, do it, otherwise you will still experience lag with every query.
|
Yep, I'm using threaded queries.
Re: Avoiding server lag -
FunnyBear - 12.02.2015
Any other tips ?
Re: Avoiding server lag -
JhnzRep - 12.02.2015
Avoid using the OnPlayerUpadte function, there are other better alternatives.
Re: Avoiding server lag -
FunnyBear - 12.02.2015
Quote:
Originally Posted by JhnzRep
Avoid using the OnPlayerUpadte function, there are other better alternatives.
|
Yeah, I use timers as an alternative to OnPlayerUpdate. Especially with my Anti-Cheat system.
Any other tips?
Re: Avoiding server lag -
JhnzRep - 12.02.2015
Loop efficiency..For example using "foreach".
But you probably know that.
Re: Avoiding server lag -
DRIFT_HUNTER - 12.02.2015
Benchmark your script (or just parts of it) to find out what causes lag and you will know what to do...
Re: Avoiding server lag -
Misiur - 12.02.2015
Yeah, use
this plugin, and find your bottlenecks.