Question about CPU overload and extensions.

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Question about CPU overload and extensions.

Postby mistermind » 25 Feb 2010, 03:24

Hello there,
We are on the final stages of our newest expansion and currently at the "stress test".
Our CPU hits 100% every 10 to 16 hours forcing me to restart SFS. When I do, CPU gets back to normal and the process starts all over again. My first clue to what could be going wrong is our server extension, programmed in AS/Javascript containing over 5000 lines of code.
Although huge, its well spread between hundreds of methods and doesn't seem to have any visible issues with the AS compiler (ASCompilerOptimizationLevel is at 9 and game seems to run very smooth).

I got 3 questions (sorry some of them will sound a little newbie, but I'm a newbie on memory and CPU usage):

- Is it possible to have a debugger analyze how many objects (or even extension instances) are active in the server so I can pin point who exactly is overloading the CPU?

- When an extension is loaded there are about 100 numeric constants that are declared upon creation, but I figured I don't have to issue a delete command on them since the extension unloads itself once the room is destroyed. What is the behavior of constants on AS/Javascript extensions?

- Of course, at beta phase we are running into several bugs each day. What happens to an extension when it encounter a bug? Does it get stuck on memory forever until I boot SFS or does the extension instance gets destroyed?
(Some of them even include unrelated type of variable as JSON translates into this:)

Code: Select all

Wrapped net.sf.json.JSONException: JSON does not allow non-finite numbers (gameStats.as#1264) Internal: -219 -- Line number:  (MainLib line: 1264)
SELECT * FROM users WHERE clue > 0
0 rows returned.
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 25 Feb 2010, 19:11

CPU overload resolved:
- Turned out to be a sequence of events that would lead into an infinite function call loop. If one client would trigger that sequence, the server would then get stuck in a single loop that consumed the entire CPU in a matter of hours.

But still, now just out of curiosity and if anyone knows, the answers for questions 2 and 3 =)
SELECT * FROM users WHERE clue > 0

0 rows returned.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 20 guests