#1

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.
Reply
#2

Perhaps infinite loop.
Reply
#3

An infinite loop would freeze the server.
Reply
#4

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.
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
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.
Well, I'm just asking what could cause the lag because I commented out everything that could cause lag, maybe someone else experienced that and found what was causing it. I can't find anything that could lag the server. :P And I only have a very old version where I used dini2, but it's less optimized than the current one I think because there is more stuff under OnPlayerUpdate so I'm not even going to try it.
Quote:
Originally Posted by iLearner
Посмотреть сообщение
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.
I use threaded queries everywhere. And it's not just commands or anything that do something. There are little delays between everything. If I type an unknown command there is a delay, if I say something there is a delay, etc.
Reply
#7

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.
Reply
#8

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
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.
I don't know anything, that's the problem. And the weird thing is that it lags while nothing happens in the background.
Reply
#9

Try commenting each line until it stops lagging, that's your only hope for now I guess.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)