Posts: 944
Threads: 128
Joined: Sep 2014
Reputation:
0
Hi, I've been working on a gamemode for a while and I noticed that my server lags even on localhost and the gamemode is at 12k lines. There are a little delays between commands and everything and the ping keeps jumping from 20 to 100, but on other servers the ping stays at 60-80. I tried commenting out the repeating 1 second timer that loops through players and I tried commenting out OnPlayerUpdate, but it's still lagging so don't ask me for any code. What I need to know is what could cause lag? I only have 4 plugins: sscanf, streamer, mysql and crashdetect. I'm pretty sure my gamemode is not even poorly optimized.
Posts: 944
Threads: 128
Joined: Sep 2014
Reputation:
0
An infinite loop would freeze the server.
Posts: 1,219
Threads: 51
Joined: Jul 2012
i think you are basically asking people to remotely find a needle in a haystack
Do you do backups? Do you have a version history? If yes, try using those, if it still lags, try going back further, if it stops lagging, compare the last version that lagged with the one that doesn't lag.
Last time i had faced this, it was due to a mysql query(not threaded), as i've read somewhere the mysql_query hangs everything and works on that query, i could suggest you to use threaded queries.
Posts: 1,794
Threads: 104
Joined: Feb 2012
Reputation:
0
We can't really help you with this as we can't guess what is producing this issue. When did this delay start, what did you code in before it started happening? Look into your very recent code after this issue took place and read it thoroughly.
Posts: 1,147
Threads: 109
Joined: Jul 2013
Reputation:
0
Try commenting each line until it stops lagging, that's your only hope for now I guess.
Posts: 2,698
Threads: 37
Joined: Mar 2012
Reputation:
0
If you're running your server with a script that is compiled with -d3 flag and crashdetect being used, your script is more likely to run slow.