SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 31/05/2013, 07:33 PM   #1
Stefand
Gangsta
 
Stefand's Avatar
 
Join Date: Sep 2011
Location: The Netherlands
Posts: 772
Reputation: 27
Default Server starts up very slowly

Hey,

I am working on A RP script, and a few weeks ago my script all loaded very quickly, all within 1 second.
Now it takes it 15 seconds to load a part... (still not much but its annoying).
What can cause this?

Regards
__________________


Scripter & Mapper
_______________________
Stefand is offline   Reply With Quote
Old 01/06/2013, 05:26 AM   #2
NickD
Little Clucker
 
Join Date: Sep 2012
Posts: 9
Reputation: 7
Default Re: Server starts up very slowly

Do you have a payed server hosting service? If so, it might be a problem with them.
If it is on your computer being hosted, it could just be your computer being slow, and not being able to process everything so quickly.
NickD is offline   Reply With Quote
Old 01/06/2013, 05:53 AM   #3
nmader
Gangsta
 
Join Date: Jul 2011
Posts: 639
Reputation: 52
Default Re: Server starts up very slowly

Well, based upon what I have noticed with what you said is that you have been working on the RP script. There are multiple things that can cause lag starting up. This includes (but not limited to) a poor saving system (such as dini if you have a large amount of player files), using up all your computer's/server's memory, and it may just be lack of CPU in the computer/server you are using to host it.

Kind Regards,
Nnmader
__________________
Script in Development
Server IP: Unavailable
Teamspeak: Unavailable
Website: Unavailable
nmader is offline   Reply With Quote
Old 01/06/2013, 06:40 AM   #4
InternationalGaming1
Little Clucker
 
Join Date: May 2013
Posts: 10
Reputation: -2
Default Re: Server starts up very slowly

SWAG
InternationalGaming1 is offline   Reply With Quote
Old 01/06/2013, 06:42 AM   #5
Stefand
Gangsta
 
Stefand's Avatar
 
Join Date: Sep 2011
Location: The Netherlands
Posts: 772
Reputation: 27
Default Re: Server starts up very slowly

Quote:
Originally Posted by NickD View Post
Do you have a payed server hosting service? If so, it might be a problem with them.
If it is on your computer being hosted, it could just be your computer being slow, and not being able to process everything so quickly.
Quote:
Originally Posted by nmader View Post
Well, based upon what I have noticed with what you said is that you have been working on the RP script. There are multiple things that can cause lag starting up. This includes (but not limited to) a poor saving system (such as dini if you have a large amount of player files), using up all your computer's/server's memory, and it may just be lack of CPU in the computer/server you are using to host it.

Kind Regards,
Nnmader
Well I contacted my host company and they said its all fine, I use MYSQL and No Dini files.
__________________


Scripter & Mapper
_______________________
Stefand is offline   Reply With Quote
Old 01/06/2013, 06:45 AM   #6
nmader
Gangsta
 
Join Date: Jul 2011
Posts: 639
Reputation: 52
Default Re: Server starts up very slowly

Quote:
Originally Posted by Stefand View Post
Well I contacted my host company and they said its all fine, I use MYSQL and No Dini files.
How large is your script? (particularly your OnGameModeInit callback.)
__________________
Script in Development
Server IP: Unavailable
Teamspeak: Unavailable
Website: Unavailable
nmader is offline   Reply With Quote
Old 01/06/2013, 07:10 AM   #7
Stefand
Gangsta
 
Stefand's Avatar
 
Join Date: Sep 2011
Location: The Netherlands
Posts: 772
Reputation: 27
Default Re: Server starts up very slowly

pawn Code:
public OnGameModeInit()
{
    /*CreateVehicle(416, 1704.2391, -1144.1865, 24.0980, 180.0000, -1, -1, 100);
    CreateVehicle(416, 1704.2391, -1135.1064, 24.0980, 180.0000, -1, -1, 100);
    CreateVehicle(416, 1704.2391, -1126.1064, 24.0980, 180.0000, -1, -1, 100);
    CreateVehicle(407, 1711.5103, -1142.6516, 24.0980, 180.0000, -1, -1, 100);
    CreateVehicle(407, 1711.5103, -1133.4160, 24.0980, 180.0000, -1, -1, 100);
    CreateVehicle(407, 1711.5103, -1124.0361, 24.0980, 180.0000, -1, -1, 100);
    CreateVehicle(490, 1718.9797, -1142.3037, 24.0980, 180.0000, 3, 1, 100);
    CreateVehicle(490, 1718.9797, -1134.4451, 24.0980, 180.0000, 3, 1, 100);
    CreateVehicle(490, 1718.9797, -1126.5286, 24.0980, 180.0000, 3, 1, 100);
    CreateVehicle(552, 1729.6388, -1126.4300, 23.6160, 180.0000, 3, 1, 100);
    CreateVehicle(498, 1745.8344, -1137.5427, 24.1906, -156.0000, 3, 1, 100);
    CreateVehicle(544, 1746.9913, -1129.4368, 24.1906, -156.0000, -1, -1, 100);
    CreateVehicle(489, 1737.0710, -1134.4435, 24.1757, 180.0000, 3, 1, 100);
    CreateVehicle(489, 1737.0710, -1127.5897, 24.1757, 180.0000, 3, 1, 100);
    CreateVehicle(597, 1729.6545, -1134.7670, 23.5764, 180.0000, 3, 1, 100);
    CreateVehicle(563, 1721.1823, -1127.2052, 35.0932, 270.0000, 3, 1, 100);*/


    mysql_debug(SQL_DEBUG);
    //mysql_log(LOG_ERROR | LOG_WARNING);
    g_connectionHandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
   
    if(mysql_ping() == 1) print(" * Connecting to MySQL: Success"); //Als mysql_ping gelijk staat aan 1 betekent dat dat er connectie is.
    else print(" x [ERROR] Connecting to MySQL: Failed"); //Zo niet, dan niet :O!
   
    Streamer_VisibleItems(STREAMER_TYPE_OBJECT, 1000);

    SetGameModeText(""#SCRIPT_MODE" "#SCRIPT_VERSION"");
    EnableStuntBonusForAll(0);
    DisableInteriorEnterExits();
    ManualVehicleEngineAndLights();
    ShowPlayerMarkers(0);
    //SetNameTagDrawDistance(Float:25);
    //DisableNameTagLOS();
   
    InitFactions();
    InitVehicles();
    InitHouses();
    LoadObjects();

   
   
    FadeInit();
   
    RandomWeatherSystem();
    SetTimer("RandomWeatherSystem",60*60*1000,1);
   
    OneSecondTimer = SetTimer("OneSecondPublic", 1000, true);
    FuelTimer = SetTimer("FuelUpdate",17000,1);
    BatteryTimer = SetTimer("BatteryUpdate",45000,1);
    SpeedUpTimer = SetTimer("SpeedUpPublic", 100, true);
    PickupsTimer = SetTimer("PickupMessages", 1000, true);
    pTimer = SetTimer("CheckPlayer", 100, true);
    ImpoundTimer = SetTimer("IsCarInArea", 1000, true);
    FlashTimer = SetTimer("FlasherFunc",200,1);
    SetTimer("TimeUpdate",1000,true);
   
    Date = TextDrawCreate(547.000000,28.000000,"--");
    TextDrawFont(Date,3);
    TextDrawAlignment(Date, 0);
    TextDrawBackgroundColor(Date, 0x000000ff);
    TextDrawSetOutline(Date, 1);
    TextDrawSetProportional(Date, 1);
    TextDrawSetShadow(Date, 1);
    TextDrawLetterSize(Date,0.399999,1.600000);
    TextDrawColor(Date,-1);
   
    Time = TextDrawCreate(547.000000,11.000000,"--");
    TextDrawFont(Time,3);
    TextDrawAlignment(Time, 0);
    TextDrawBackgroundColor(Time, 0x000000ff);
    TextDrawSetOutline(Time, 1);
    TextDrawSetProportional(Time, 1);
    TextDrawSetShadow(Time, 1);
    TextDrawLetterSize(Time,0.499999,1.800000);
    TextDrawColor(Time,-1);
    for (new x=0; x<MAX_VEHICLES; x++)
    {
        LightPwr[x]=1;
        Flasher[x]=0;
        FlasherState[x]=0;
    }
   
   
    //ASGH
    Stones(CreateObject(12814, 1230.73, -1310.15, 12.35, 0.00, 0.00, 180.13, 250.0));
    Stones(CreateObject(12814, 1230.91, -1360.13, 12.35, 0.00, 0.00, 0.13, 250.0));

//And maybe 100+ texdraws
__________________


Scripter & Mapper
_______________________
Stefand is offline   Reply With Quote
Old 01/06/2013, 07:18 AM   #8
DobbysGamertag
Gangsta
 
DobbysGamertag's Avatar
 
Join Date: Jan 2013
Location: England
Posts: 805
Reputation: 100
Default Re: Server starts up very slowly

If OnGameModeInit is so big that could be why


Why is it so big? Is there a reason for so many TD's?
DobbysGamertag is offline   Reply With Quote
Old 01/06/2013, 07:20 AM   #9
Stefand
Gangsta
 
Stefand's Avatar
 
Join Date: Sep 2011
Location: The Netherlands
Posts: 772
Reputation: 27
Default Re: Server starts up very slowly

Quote:
Originally Posted by DobbysGamertag View Post
If OnGameModeInit is so big that could be why


Why is it so big? Is there a reason for so many TD's?
Yes,

It looks better IG, Its for housees businesses, wrong cmds.
__________________


Scripter & Mapper
_______________________
Stefand is offline   Reply With Quote
Old 01/06/2013, 07:24 AM   #10
DobbysGamertag
Gangsta
 
DobbysGamertag's Avatar
 
Join Date: Jan 2013
Location: England
Posts: 805
Reputation: 100
Default Re: Server starts up very slowly

It was just a question. No need to -rep. That could be the reason. Try commenting it out and try then.
DobbysGamertag is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server starts, and stops SomebodyAndMe Scripting Help 4 29/07/2012 09:16 AM
Server starts, and stops SomebodyAndMe Server Support 3 27/07/2012 07:36 PM
SA-MP Server Starts Up By PHP Great!... But... AustinJ Server Support 9 21/09/2011 10:55 PM
How to get script that starts EXACTLY when an NPC's path starts MisterTickle Scripting Help 11 18/09/2011 09:03 AM
[HELP]Server starts then closes [NYRP]Mike. Help Archive 10 13/12/2009 01:44 PM


All times are GMT. The time now is 06:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.