Server lag - infinite loop detection help [REP++]
#1

Hello guys, i own a server with 300players+ and if they are more than 200 server starts lagging as hell.

My includes are:

pawn Код:
#include       <a_mysql>
#include                <a_samp>
#include                <GeoIP_Plugin>
#include                <streamer>
#include                <OPSP>
#include           <a_zones>
#include                <sscanf2>
#include                <beaZone>
#include           <fly>
#define                 YSI_NO_MASTER
#include                <YSI\y_commands>
#include                <YSI\y_ini>
#include                <YSI\y_flooding>
#include                <YSI\y_iterate>
#include           <*******>
#include                <OnPlayerUseVending>
#include          <OnPlayerFakeKill>
#include              <OnPlayerPause>
#include                <Firewerkz>
#include          <GetVehicleColor>
#include          <mSelection>
#include                <death>
#include                <progress>
#include                <crashdetect>
I am pretty sure that the infinite loop it's not caused by a "while" or "for" , i think it's caused by placing something wrong somewere.
Some ideeas?

I rep you , thanks!
Reply
#2

Run profiler plugin.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Run profiler plugin.
I did what you said , I got big time to some functions , tried to fix them but still server lagging as hell. I have the best hosting provider in my country for sa:mp.
Can you give your contact Skype id or yahoo or something ? I need your help disperatly.
Reply
#4

Showing us something might help.

It is most likely not an infinite loop, but more likely a function or timer being called excessively.

Are you also sure that this is not network lag? You know some people like to attack larger servers.
Reply
#5

Check whether it does it when there's players on or not, and whether it does it when it's open to the internet or not. Also slowly let players join by increasing the player allowance to see if it's gradual, or whether it's with a certain amount it starts.

That'd give a little bit of a clue.
Reply
#6

Can someone give me more examples of loops at onplayerspawn , onplayerdeath etc. ?

Can PreloadAnimLib at OnPlayerSpawn affect ?


Edit:

pawn Код:
stock PreloadAnimLib(playerid, animlib[]) {
    return ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
pawn Код:
OnPlayerSpawn -
        PreloadAnimLib(playerid,"BOMBER");
    PreloadAnimLib(playerid,"RAPPING");
    PreloadAnimLib(playerid,"SHOP");
    PreloadAnimLib(playerid,"BEACH");
    PreloadAnimLib(playerid,"SMOKING");
    PreloadAnimLib(playerid,"ON_LOOKERS");
    PreloadAnimLib(playerid,"DEALER");
    PreloadAnimLib(playerid,"CRACK");
    PreloadAnimLib(playerid,"CARRY");
    PreloadAnimLib(playerid,"COP_AMBIENT");
    PreloadAnimLib(playerid,"PARK");
    PreloadAnimLib(playerid,"INT_HOUSE");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"GANGS");
    PreloadAnimLib(playerid,"PED");
    PreloadAnimLib(playerid,"FAT");
Reply
#7

If it was an infinite loop then your server would have crashed in short time after you started experiencing lag and nothing would have worked anymore (no connections, no command processing, no (foot/vehicle/aim/whatever) sync) and server_log would be spammed with "Incoming connection" messages.

My guess is that your server sends/recieves too many packets and network can't handle them properly anymore. I suggest you to increase all *_rate settings in server.cfg. Also you should send network data only when needed, not everytime when a callback is called. (eg. preloading anims, you should do that once for every player at first spawn, not at EVERY spawn)
Furthermore you should check what GetNetworkStats returns at different times and different number of players.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)