Server Lag -
Alpay0098 - 12.11.2015
Hi there;
I have a server based on a 4GB Ram, Other things is too good and don't need to discuss about them.
Also I have about average 15 players online.
And now sometimes when player die, it lags a little bit. Time stops for 8 second or sometimes textdraws doesn't appear.
GM is SQLited and Data's not that much heavy.
I wanna know the reason. Also my samp-server version is 0.3.7-R2.
I'll appreciate the best answer.
Re: Server Lag -
Yousha - 12.11.2015
non-English: man mitoonam GM et ro debug konam, besharte inke beham rikhte va sholoogh polookh nabashe..
Re: Server Lag -
Sublime - 13.11.2015
Poorly optimized script.
Re: Server Lag -
HydraHumza - 13.11.2015
It's seems ur server code is poorly written optimized ur code.
Re: Server Lag -
Alpay0098 - 13.11.2015
Quote:
Originally Posted by Yousha
non-English: man mitoonam GM et ro debug konam, besharte inke beham rikhte va sholoogh polookh nabashe..
|
Na merci xD
Quote:
Originally Posted by Sublime
Poorly optimized script.
|
How can I do it , can you suggest some ways to do it please?
Quote:
Originally Posted by Humza
It's seems ur server code is poorly written optimized ur code.
|
Thank you so much, my answer to your text is in the ABOVE QOUTE.
Re: Server Lag -
Yousha - 13.11.2015
Quote:
How can I do it , can you suggest some ways to do it please?
|
My suggestion:
- Optimize your database.
- Fix errors/warnings in server_log.txt and mysql_log.txt...
- Fix bugged/removed fields, tables and queries.
- Remove unnecessary codes from TIMERS.
- Reduce the Strings sizes... to 128, 64, 32, 8 or less. (if possible)
- Sometimes releasing/freeing Long strings(like 1024, 2048...) may helps.
- Convert Public functions to local. (if they are not used in Timers/Callbacks)
- Remove Duplicated codes.
- Try to use FOREACH instead of FOR. (it's faster and improved)
- Try to use ZCMD/IZCMD instead of DCMD and SAMP's callback.
- Delete the log files and remake them.
- Reduce unused/non-rp objects from your maps.
- When writing commands, FIRST you must check if player has Perm to use it, THEN make/set the variables. (such strings)
- Update your plugins and includes.
- Remove Duplicated Objects from your maps.
- Set the "MAX_PLAYERS" to real capacity.
- Remove unused DEFINES from your codes.
and such improvements...
Re: Server Lag -
BiosMarcel - 31.12.2016
Quote:
Originally Posted by Yousha
My suggestion:
- Optimize your database.
- Fix errors/warnings in server_log.txt and mysql_log.txt...
- Fix bugged/removed fields, tables and queries.
- Remove unnecessary codes from TIMERS.
- Reduce the Strings sizes... to 128, 64, 32, 8 or less. (if possible)
- Sometimes releasing/freeing Long strings(like 1024, 2048...) may helps.
- Convert Public functions to local. (if they are not used in Timers/Callbacks)
- Remove Duplicated codes.
- Try to use FOREACH instead of FOR. (it's faster and improved)
- Try to use ZCMD/IZCMD instead of DCMD and SAMP's callback.
- Delete the log files and remake them.
- Reduce unused/non-rp objects from your maps.
- When writing commands, FIRST you must check if player has Perm to use it, THEN make/set the variables. (such strings)
- Update your plugins and includes.
- Remove Duplicated Objects from your maps.
- Set the "MAX_PLAYERS" to real capacity.
- Remove unused DEFINES from your codes.
and such improvements...
|
- Unused defines don't do shit, since it is pre compiled stuff
- appending to big logfiles shouldn't really influence performance
- ZCMD is slow, use Pawn.CMD (got flags and command aliases, i love it)
- removing objects from the map actually takes performance
How do you optimize stuff? Well ... ask ******
Re: Server Lag -
SickAttack - 31.12.2016
Quote:
Originally Posted by [Bios]Marcel
- Unused defines don't do shit, since it is pre compiled stuff
- appending to big logfiles shouldn't really influence performance
- ZCMD is slow, use Pawn.CMD (got flags and command aliases, i love it)
- removing objects from the map actually takes performance
How do you optimize stuff? Well ... ask ****** 
|
PAWN.CMD is horribly slow if you use the callbacks.
Possible answers: Your script isn't performance friendly. Your host isn't that reliable. Players' internet connection isn't good or their ping is terrible.
Re: Server Lag -
Yousha - 31.12.2016
Quote:
Originally Posted by [Bios]Marcel
- Unused defines don't do shit, since it is pre compiled stuff
- appending to big logfiles shouldn't really influence performance
- ZCMD is slow, use Pawn.CMD (got flags and command aliases, i love it)
- removing objects from the map actually takes performance
How do you optimize stuff? Well ... ask ****** 
|
You must be new in programming... Welcome
Re: Server Lag -
BiosMarcel - 31.12.2016
Quote:
Originally Posted by Yousha
You must be new in programming... Welcome 
|
no but i might do mistakes (often, lol)
But if u say something like that, at least correct me, otherwise its just stupid :P
Quote:
Originally Posted by SickAttack
PAWN.CMD is horribly slow if you use the callbacks.
Possible answers: Your script isn't performance friendly. Your host isn't that reliable. Players' internet connection isn't good or their ping is terrible.
|
Good to know, thanks
By the way here i try to prove a part of what i said earlier (which i might fail at, lol):
Quote:
appending to big logfiles shouldn't really influence performance
|
Appending to Logfiles (1KB logfile vs 95000 KB logfile), appending the word "Test" a thousand times.
i made it a couple of times:
PHP код:
Benchmarking
Small file: 3454 ms
Large file: 3719 ms
Benchmarking is done.
PHP код:
Benchmarking
Small file: 4336 ms
Large file: 4430 ms
Benchmarking is done.
PHP код:
Benchmarking
Small file: 5203 ms
Large file: 4854 ms
Benchmarking is done.
PHP код:
Benchmarking
Small file: 4883 ms
Large file: 4994 ms
Benchmarking is done.
PHP код:
Benchmarking
Small file: 5030 ms
Large file: 4990 ms
Benchmarking is done.
Quote:
Unused define don't do shit
|
Well, here is some assembly code for ya:
With unused defines:
PHP код:
CODE 0 ; 0
;program exit point
halt 0
proc ; main
; line 6
zero.pri
retn
STKSIZE 1000
Without unused defines:
PHP код:
CODE 0 ; 0
;program exit point
halt 0
proc ; main
; line 4
zero.pri
retn
STKSIZE 1000
Well, i have to say no more, right?
Too lazy tot try and prove the rest, anyways removing default buildings is totally unneccessary i think, rather optimize the rest
About pawn cmd, since i have already been told the usage of the callbacks make it slow , actually i like those callbacks, sad to hear that, sorry for providing wrong information