Server hangs for some seconds
#1

I dont know how to sort it out, nor do i get any logs in console, but apparently the server freezes for about 8 to 10 seconds, means, everything freezes, anything you typed, people will be afk for you and cant send anything in chat, when this happens irc freezes aswell, once it over its back to normal and occurs after kinda 30 to 60 mins.

Whatever cmd / chat you typed will popup after its over.

This is my onplayerupdate:

PHP код:
lastOPU[playerid] = GetTickCount();
    if (
isafk_{playerid})
    {
        
UpdateDynamic3DTextLabelText(afklabel[playerid], 0xFFFF00FF," ");
        
isafk_{playerid} = false;
    }
    new 
keysudlr;
    
GetPlayerKeys(playeridkeysudlr);
    if (
ud != || lr != 0ac_vars[playerid][ac_lastudlr] = GetTickCount(); 
Any suggestions? or maybe how to debug the problem? i have -d3 and all those flags.

This is the only unusual thing i see in console (happens when i load my .db file, doesnt happen if i dont laod it.)
PHP код:
[08:44:22] [debugRun time error 4"Array index out of bounds"
[08:44:22] [debug]  Accessing element at index 12 past array upper bound 11
[08:44:22] [debugAMX backtrace:
[
08:44:22] [debug#0 000a7d24 in public IRC_OnGameModeInit () at ffs.pwn:600
[08:44:22] [debug#1 native CallLocalFunction () from samp03svr
[08:44:22] [debug#2 0002a9fc in public zcmd_OnGameModeInit () at C:\Users\iLearner\Desktop\ffss\pawno\include\irc.inc:199
[08:44:22] [debug#3 native CallLocalFunction () from samp03svr
[08:44:22] [debug#4 00029a70 in public SSCANF_OnGameModeInit () at C:\Users\iLearner\Desktop\ffss\pawno\include\zcmd.inc:68
[08:44:22] [debug#5 00023114 in ?? () at C:\Users\iLearner\Desktop\ffss\pawno\include\sscanf2.inc:174
[08:44:22] [debug#6 00007a18 in public Itter_OnGameModeInit () at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_hooks/impl.inc:483
[08:44:22] [debug#7 native CallLocalFunction () from samp03svr
[08:44:22] [debug#8 0000214c in public ScriptInit_OnGameModeInit () at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_iterate.inc:791
[08:44:22] [debug#9 00000d6c in public OnGameModeInit () at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\internal\..\y_scriptinit.inc:171 
Dont really think the vps is the problem, cuz we had 1gb ram vps, it used to do this and thus we upgraded to 2 gb ram still same.
Reply
#2

Anyone ?
Reply
#3

Does the issue occur when you load your .db file or does it occur regardless of you loading .db file or not?

The issue could be numerous things but the best guess I can come up with is that you either made a loop that is not healthy or something similar. The only thing I am more or less sure is your gamemode has optimization errors.
Reply
#4

I dont think it has anything to do with database.db
Reply
#5

As someone said, this might be due to max cpu usage... i went in panel i found:
Quote:

CPU Usage 3.27%

Reply
#6

Callback OnGameModeInit () Line : 600

Post it here
Reply
#7

I managed to fix the backtrace, but that has nothing to do with my issue.
Reply
#8

Well if you really have no idea what it is, do the following:

Add a time measurement to every callback that is not just a few lines.

Simplest way is putting this in the beginning:

PHP код:
new tick GetTickCount(); 
and this at the end:

PHP код:
printf("Callback(): %d ms"GetTickCount() - tick); 
When you find the callback or function, go further and add debug prints, etc.

Or use the Profiler Plugin.
There is also an include for this, but I cannot recall the name. But it's not much work to do anyway.
This way you at least know where it hangs, that makes it way easier to find the error.
The code you gave us is not helpful to us, at least OnPlayerUpdate is not the cause.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)