Server Lag
#1

It seems that with more than 7 players on, my server starts to lag like crazy.



5 GB Dedicated RAM
120 GB RAID SATA Storage
6 Cores

I thought that was fine to run a single SA:MP server...
Reply
#2

BASIC instructions:

1) Check bad loops

2) https://sampforum.blast.hk/showthread.php?tid=271129

3) Optimise script

4) https://sampforum.blast.hk/showthread.php?tid=57018

5) Check for heavy load under OnPlayerUpdate and shift it to a timer

6) Do you use non - theaded queries in MySQL? (If)

7) Profit!

If you have done that, do reply with some results!

Cheers
Reply
#3

well my onplayerupdate could be better, but i dont really know how :P, can you help?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(pid) == 2)
    {
        new id = GetPlayerVehicleID(pid);
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
        if(seatbelt[playerid] == 0)
        {
            PlayerTextDrawShow(playerid, fasten);
            PlayerTextDrawShow(playerid, belt);
        }
        if(engine == 0)
        {
            PlayerTextDrawShow(playerid, check);
            PlayerTextDrawShow(playerid, engine1);
        }
        if(engine == 1)
        {
            PlayerTextDrawHide(playerid, check);
            PlayerTextDrawHide(playerid, engine1);
        }
        if(0 < VehicleInfo[id][vFuel] <= 10)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "l");
            return 1;
        }
        if(10 < VehicleInfo[id][vFuel] <= 20)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "ll");
            return 1;
        }
        if(20 < VehicleInfo[id][vFuel] <= 30)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "lll");
            return 1;
        }
        if(30 < VehicleInfo[id][vFuel] <= 40)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "llll");
            return 1;
        }
        if(40 < VehicleInfo[id][vFuel] <= 50)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "lllll");
            return 1;
        }
        if(50 < VehicleInfo[id][vFuel] <= 60)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "llllll");
            return 1;
        }
        if(60 < VehicleInfo[id][vFuel] <= 70)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "lllllll");
            return 1;
        }
        if(70 < VehicleInfo[id][vFuel] <= 80)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "llllllll");
            return 1;
        }
        if(80 < VehicleInfo[id][vFuel] <= 90)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "lllllllll");
            return 1;
        }
        if(90 < VehicleInfo[id][vFuel] <= 100)
        {
            PlayerTextDrawSetString(playerid, fuellevel, "llllllllll");
            return 1;
        }
        return 1;
    }
    return 1;
}
Reply
#4

That's fine to run an SA:MP server ,mainly , lag is caused from low bandwidth ..speed test, test you connection with a server , maybe your server location is far from players regions
Reply
#5

Quote:
Originally Posted by SDLMMM
Посмотреть сообщение
That's fine to run an SA:MP server ,mainly , lag is caused from low bandwidth ..speed test, test you connection with a server , maybe your server location is far from players regions
It lags for everyone, check the main post, i did a speed test under load. It was even lagging with 50 ping.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)