Server stucking... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Server stucking... (
/showthread.php?tid=488911)
Server stucking... -
deividass - 19.01.2014
Hi, I want to ask, why my server is always geting stuck? Servers shows players online, but no one can join it, in log it starts print "Incoming connection...".
Re: Server stucking... -
ColorHost-Kevin - 19.01.2014
Did you contact your host on this? Perhaps it might be a issue on their end?
Re: Server stucking... -
deividass - 20.01.2014
Quote:
Originally Posted by ColorHost-Kevin
Did you contact your host on this? Perhaps it might be a issue on their end?
|
I have VPS server and the problem ocours only from saturday. So I dobt that is VPS problems.
P.S. in linux command "top -c" samp server proces shows 100+% cpu.
Re: Server stucking... -
MahdiGames - 20.01.2014
You have to contact your VPS Host, it may be CBU is full just upgrade it!
_________________
Hosted Tab Game-MP for 10 Euro / per month
Hosted Tab + Server host 50 slots + Control Panel for 15 Euro
Skype: MahdiAsali
Re: Server stucking... -
deividass - 20.01.2014
Quote:
Originally Posted by MahdiGames
You have to contact your VPS Host, it may be CBU is full just upgrade it!
_________________
Hosted Tab Game-MP for 10 Euro / per month
Hosted Tab + Server host 50 slots + Control Panel for 15 Euro
Skype: MahdiAsali
|
But if it stucks random, it still can be CBU problem?
Re: Server stucking... -
Vince - 20.01.2014
An infinite loop is notorious for blocking server execution and causing 100% CPU usage. Either that, or you're still being attacked by the tool that
this patch has solved.
Re: Server stucking... -
Mr.Faqahat - 20.01.2014
Or You can Optimize your server scripts to use less CPU.
Re: Server stucking... -
deividass - 20.01.2014
Quote:
Originally Posted by Mr.Faqahat
Or You can Optimize your server scripts to use less CPU.
|
Thats not an optimization fault...
I'll try to search infinitive loop, so much work ;/
Re: Server stucking... -
Michael@Belgium - 20.01.2014
I had (and i actually still have) this issue, but as Vince said, it's mostly due to an infinite loop.
Also; try to debug and you'll find where it causes the "server freeze"
Quote:
Originally Posted by Dr.Einstein
Sorry for bumping this topic, but this is important.
I had this problem with my server and I fixed it.
As Mellnik said, it is a timer in the game-mode itself and not on any filter-scripts. We all know that this problem is caused by a while loop. So, I did some tests, if the infinite loop is in a filter-script, the r-con commands do work and players are able to join. On the other hand, if that infinite loop is in the game-mode itself, then the sever will seem OK, but it is actually frozen and no one can join, hence Kicking IP *.*.*.*:**** because they didn't log on to the game..
The way I came around it is by checking all my while loops. Now, I didn't know which one of them actually caused the problem so I added a sentinel for each 'while' loop that I found, so if a loop counter is passed that, a message would show on the logs telling me that the this loop is broken.
Example:
Код:
new counter=0, i;
while(i == 1)//we know that this is an infinite loop because we do not change the value of 'i'
{
// our normal code in here and at the end we increment the counter and check to see if we have a problem...
if(++counter >= 5000)//now, you can change the sentinel value to whatever fits the use of your loop
{
printf("Infinite loop has been stopped. Loop at function: 'function name'"); // we place the function name so we can pinpoint the problem and do something about the loop.
break; //we break the loop.
}
}
|
Re: Server stucking... -
Mr.Faqahat - 20.01.2014
Quote:
Originally Posted by deividass
Thats not an optimization fault...
I'll try to search infinitive loop, so much work ;/
|
Maybe, but last i time i had this problem, i found that my script and especially server saving system and all that was using too much cpu sometimes so. i had to optimize it and it worked for you it might be anyother reason.