Posts: 228
Threads: 4
Joined: Apr 2011
Reputation:
0
Hello. My server currently is massive lagging. Tried 2 hosts, also a VPS an it still lags as hell. Hosting company even sent me a message saying my server is going on 100 percent CPU usage, for me to fix my scripts...
What can cause lag? I saw all.. Timers are not that much, some 5. I killed them all.. They are all about vehicle stuff, and all are killed under OnPlayerExit vehicle.
After restart, lag is gone, but thenn after some time, it starts to increase and increase,and it takes like one or two minutes to see the messages what we've wrote in chat.
Anyway i could put something in the script to see where lag comes from?
Thank you for any help.
Posts: 1,599
Threads: 164
Joined: Dec 2010
Reputation:
0
Does the lag continues all the time if you don't restart or are like strikes?
Btw, when you say your hosting company sent you a message, they say it is good? Or it is running at 100%? They usualy only send that message when something is wrong. If it's the case, it's for sure your script.
Posts: 228
Threads: 4
Joined: Apr 2011
Reputation:
0
Server is using a unique script(made from scratch) with ZCMD,sscanf.I really can't figure out what the heck is causing those lags.After a restart everything runs in their norms,after some twenty-thirty minutes there starts the hell,massive lags.
Posts: 228
Threads: 4
Joined: Apr 2011
Reputation:
0
It couldn't be bad script or bad hosting services,script is quite advanced.It's some few days when server is running.I've changed more times host,actually this is the 3nd one which I'm using for this unique game-mode, and hosting services still are saying that server runs fine.It couldn't be bad script,probably somewhere is a fault in script which causes the lag.Once server was lagging pretty hard when players were using vehicles,it caused the lag,but it's solved and it doesn't anymore(same for walking in one place,where's more people)
As well server was pretty bad lagging when we reached more players..
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
What do you have under OnPlayerUpdate?
Posts: 2,421
Threads: 52
Joined: Mar 2009
Reputation:
0
Show the function"f_OnPlayerUpdate(playerid)" if there's a lot of (inefficient) code or large loops inside it, that's your problem.
Also check your code for large loops and see if you can think of a way to replace them.