CPU Load

Submit all your BlueBox related questions or report a bug here!

Moderators: Lapo, Bax

Dod
Posts: 19
Joined: 25 Aug 2009, 17:20

CPU Load

Postby Dod » 16 May 2010, 13:23

At random times cpu goes +100% and stays there forever, if i restart bluebox from admin tool goes down to 1-2% which is normal.

Server is working ok and bluebox is working ok, but i can see smartfox's cpu at top command 100% all the time. When bluebox restarts load is fine, and after 2-3 days at a random time goes up again.

I dont use bluebox commands nowhere in extensions or something.

Bluebox have at peak times 50-60 users.
User avatar
Lapo
Site Admin
Posts: 19937
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 May 2010, 06:19

Unless you are running short of CPU/RAM this shouldn't happen.
How do you restart the bluebox?
Try switching off the BlueBox for a while and see if the problem happens again. Also make sure you are using the last server patch (1.6.8)

I dont use bluebox commands nowhere in extensions or something.

There's no BlueBox commands to use in your code. The BlueBox connection is activated by the API whenever a socket connection is not possible from the client end
Lapo
--
gotoAndPlay()
...addicted to flash games
Dod
Posts: 19
Joined: 25 Aug 2009, 17:20

Postby Dod » 17 May 2010, 11:59

I restarting bluebox by clicking "Toggle Status" from the sfs admin tool in the bluebox monitor tab (two times one for "off" once again for "on") and everything goes back to normal (cpu -100%).

I use last server patch .
User avatar
Lapo
Site Admin
Posts: 19937
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 May 2010, 13:11

50-60 users connected via BlueBox are usually not enough to produce any significant CPU load, unless your system is already low on resources.

What is the average number of concurrent users on your machine?
Is it a dedicated server?
How much Ram/CPUs do you have?
Did you change the JVM memory settings, if so how?
Lapo

--

gotoAndPlay()

...addicted to flash games
Dod
Posts: 19
Joined: 25 Aug 2009, 17:20

Postby Dod » 17 May 2010, 17:28

50-60 bluebox users, 5000 users smartfox, server has 8 cores, 8gb ram.

java's max heap memory is 3gb. Server is not low at resources or something.

The problem is that sfs' cpu in the previous second was 1-2% the next second goes 100% at random time once at 2-3 days (and stays there forever and at 8 in the morning as there is no more than 100 users inside and noone at bluebox)....until i restart bluebox and goes down at 1-2%.

I had 200 bluebox users concurrently and cpu was fine...this happens suddenly and not have to do with users it is something like an endless loop or deadlock or something and when i restart bluebox all goes back to normal...it also happened when server had 10-20 bluebox users and 1500-2000 at all.
User avatar
Lapo
Site Admin
Posts: 19937
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 May 2010, 06:25

Is your BBox version 1.0.5?
Did you try checking the BlueBox logs? Maybe someone is attacking the http server.
The fact that the problem happened with 50 users but not with 200 is also strange. Did you change the httpPollSpeed property in your client? If so what value do you use?

Finally the quickest way to find the culprit here would be to plugin a profiler like VisualVM in the production server and activate the CPU monitoring to see which calls are causing such CPU jumps.

VisualVM --> https://visualvm.dev.java.net/
Lapo

--

gotoAndPlay()

...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Postby udikantz » 08 Mar 2011, 16:28

I suffer from the same problem.
We are using smartfox for a long time on a strong dedicated machine quad core xeon 6GB RAM.

We had 2000+ concurrent users with 2%-4% cpu load....
We have recently added bluebox license when we have 70 connections with bluebox and less than 1000 on tcp we see picks of 20% CPU.

When we kill the bluebox server the cpu is back to normal. so somehow the bluebox is taking alot of CPU.

m_server.blueBoxPort = 80;
m_server.httpPollSpeed = 500;


Any ideas?
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 19937
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 08 Mar 2011, 16:33

How many concurrent BlueBox users are you running?
Of course the BlueBox consumes a lot more resources than regular sockets because it is based on HTTP requests which are not as lightweight.

There's not much you can do about it. Also if your CPU runs at 20% you have plenty of resources, I don't think there's much to worry about.
Lapo

--

gotoAndPlay()

...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Postby udikantz » 09 Mar 2011, 09:10

20% CPU for 70 concurrent BlueBox users.
diwip games - co founder & CPO.



http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 19937
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 11 Mar 2011, 17:45

Ok.
I can't say if it's good or not. It depends on what your application does, how heavy and frequent are messages etc...
In general I don't see anything wrong with these values.

Also take into account that the BlueBox is very optimized for this task, it uses a very efficient web server, a highly optimized polling technique that offloads a lot of the polling burden etc...
A regular HTTP server wouldn't be able to keep up with this.

The only solution that currently can outperform the BlueBox is the new BlueBox2 in SFS2X. There we were able to apply even more low level optimizations thanks to the new SFS2X engine.

Basically the new BlueBox2X uses in-process connections (instead of localhost sockets) to talk to SFS2X, using even less resources and CPU cycles.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 1 guest