30.10.2017, 16:12
Hi,
After having done some development works on my gamemode, I recently transferred it onto a VPS server that operates a Debian 8 OS. The gamemode was working fine on Windows but when I run it on Debian, the server works for a while and then suddenly all functions start executing at such speed that it crashes the game mode.
I have debugged the callbacks that use the only one global timer I have but I can't see any correlation as of yet.
Sekundnik - One second timer
Piec_Sekund - Five seconds timer
Dwadziescia_Sekund - Twenty seconds timer
What you see above is the one second timer being called a every a little more than one second and then suddenly starting to get called repeatedly 100s of times per second. The server gets overloaded and crashes.
The gamemode uses only one timer as such but every second it updates global variables such as global_timer_5_seconds and triggers respective callbacks if the value is higher than for example 5. There is a limit of calling one timer-callback per second, as follows:
So I suppose (and the logs seem to support this claim) the functions are not called in an overlapping manner.
Any ideas what could be the reason?
After having done some development works on my gamemode, I recently transferred it onto a VPS server that operates a Debian 8 OS. The gamemode was working fine on Windows but when I run it on Debian, the server works for a while and then suddenly all functions start executing at such speed that it crashes the game mode.
I have debugged the callbacks that use the only one global timer I have but I can't see any correlation as of yet.
Код:
[16:58:52] [debug] Callback Sekundnik executed [16:58:53] [debug] Callback Sekundnik called [16:58:53] [debug] Callback Sekundnik executed [16:58:55] [debug] Callback Sekundnik called [16:58:55] [debug] Callback Sekundnik executed [16:58:56] [debug] Callback Sekundnik called [16:58:56] [debug] Callback Sekundnik executed [16:58:56] [debug] Callback Sekundnik called [16:58:56] [debug] Callback Dwadziescia_Sekund called [16:58:56] [debug] Callback Dwadziescia_Sekund executed [16:58:56] [debug] Callback Sekundnik executed [16:58:56] [debug] Callback Sekundnik called [16:58:56] [debug] Callback Sekundnik executed [16:58:56] [debug] Callback Sekundnik called [16:58:56] [debug] Callback Piec_Sekund called [16:58:56] [debug] Callback Piec_Sekund executed [16:58:56] [debug] Callback Sekundnik executed [16:58:56] [debug] Callback Sekundnik called [16:58:56] [debug] Callback Sekundnik executed [16:58:56] [debug] Callback Sekundnik called [16:58:56] [debug] Callback Sekundnik executed
Piec_Sekund - Five seconds timer
Dwadziescia_Sekund - Twenty seconds timer
What you see above is the one second timer being called a every a little more than one second and then suddenly starting to get called repeatedly 100s of times per second. The server gets overloaded and crashes.
The gamemode uses only one timer as such but every second it updates global variables such as global_timer_5_seconds and triggers respective callbacks if the value is higher than for example 5. There is a limit of calling one timer-callback per second, as follows:
PHP код:
if(global_5_second_timer_value > 5)
{
global_5_second_timer_value = 0;
Piec_Sekund();
}
else if(global_20_second_timer_value > 20)
{
global_20_second_timer_value = 0;
Dwadziescia_Sekund();
}
else if(global_60_second_timer_value > 60)
{
global_60_second_timer_value = 0;
Minuta();
}
else if(global_300_second_timer_value > 300)
{
global_300_second_timer_value = 0;
Piec_Minut();
}
else if(global_600_second_timer_value > 600)
{
global_600_second_timer_value = 0;
Dziesiec_Minut();
}
else if(global_900_second_timer_value > 900)
{
global_900_second_timer_value = 0;
Pietnascie_Minut();
}
if(SCRIPT_DEBUG == 1) printf("[debug] Callback Sekundnik executed");
Any ideas what could be the reason?