9.2 BlueBox frequently asked questions
-
What's the recommended value for polling speed?
A value between 750-1000ms. is very good for all chatting, turn-based games and similar kind of applications.
It will add minimum lag to the client responsiveness and it will keep the server cpu usage low.
Lower values (200-500ms.) can be used where a faster responsiveness is necessary. For super fast real-time games you can try values
between 50 and 100ms. We don't recommend using values below 50ms.
With settings < 200 ms. the cpu usage will grow significantly as the http connection and packet wrapping/unwrapping is more expensive than
using a persistent connection.
-
What's the difference between regular polling and the BlueBox polling?
With "regular polling" the client will ask the server for new data/events every x seconds.
This is quite inefficient as the server will receive many continuous requests even when there's nothing to send back to the client.
Additionally there are times when an event occurs just a few milliseconds after the client asked for new data. If this happens the lag time
is almost doubled as the client didn't receive anything in the last poll request and now has to wait another full interval before he can ask again.
Because of this, even if the poll interval is set to 1 second, the lag can get as high as 2 seconds!
The SmartFoxServer BlueBox optimizes both scenarios by suspending HTTP requests and resuming them immediately, as data becomes available.
The result is that server minimizes the client lag, greatly enhances the performance and makes smart use of resources and bandwidth.
Additionally this allows the BlueBox to support extremely low polling values such as 300ms. (and lower) without the risk of bombarding the server with requests when no data is
available for the client.
-
What's the recommend SmartFoxServer/BlueBox port configuration?
Probably one of the best TCP port configuration is the following:
- SmartFoxServer listening on port 443 (https)
- BlueBox listening on port 80 (http)
These ports are highly likely to be open on most local networks as they provide access to http servers.
With this configuration the client will first try to establish a socket connection on port 443 and if this is unavailable it
will connect to the http-tunnel provided by the BlueBox.
NOTE:
Under Linux/Unix you will require root privileges to run applications that listen on port numbers < 1024
By default the Server is configured this way:
- SmartFoxServer: port 9339
- BlueBox: port 8080
-
How do I change the default port (8080) used by the BlueBox
The BlueBox servlet runs in the embedded Jetty http-server. In order to change the TCP port it uses you will simply have to change the Jetty configuration and restart it. All the details are found at chapter 2.3 of the documentation
-
How many concurrent clients can be handled by the BlueBox?
It's difficult to estimate, it all depends on the hardware, the type of game/application and the client latency settings.
If you plan to run thousands of http connections we highly recommend a 2x or 4x multi-core CPU.
-
Is it possible to run the BlueBox on a dedicated server?
Yes, the BlueBox can run on its own dedicated machine.
Using a dedicated server exclusively for HTTP connections enhances the performance further when handling thousands of clients or when using very low polling settings.
-
How do I run the BlueBox on a dedicated server?
The BlueBox can be moved to a dedicated server by running it in standalone mode, in a Jetty http server instance. It is required that both the BlueBox machine and the SFS machine are located in the same LAN to avoid performance problems.
The following steps will guide you in setting up a standalone BlueBox:
- Download and install the Jetty 6.x http server from their website
- Copy the BlueBox.war file from {your-sfs-installation-folder}/Server/webserver/webapps/ to the webapps/ folder in the freshly installed Jetty server.
- Copy the bluebox.properties file from {your-sfs-installation-folder}/Server/ to the new Jetty root folder.
-
Edit the copied bluebox.properties file by changing the serverMode to stand-alone, point the address and port to the SmartFoxServer
instance and finally add a new parameter called client_idle_request_time which should match the webapps/ folder setting of your SmartFoxServer.
The following is an example of the final configuration:
log_level=FINER
log_folder=./logs/
log_max_size=100000
log_max_files=5
serverMode=stand-alone
sfsAddr=10.10.10.1
sfsPort=9339
client_idle_time=30
client_idle_request_time=300
debug_mode=false
-
Does the BlueBox limit any of the SmartFoxServer features?
With the the exclusion of a couple of minor things, no. All the features are available as if it was used with socket connections.
The only limitations are:
- Banning by IP address
- IP Filtering
These two features won't be available because BlueBox-ed users don't establish a direct connection with the server.
-
When a user closes the browser he still appears to be connected for some time. Is this normal?
When a client closes the connection by quitting the Flash Player / browser you may still see him as connected to the
server. This is due to the fact that BlueBox does not use persistent connections, hence it can't immediately detect when
a client gets disconnected. In order to determine this it uses a timeout which can be changed in the bluebox.properties file.
The property is called client_idle_time and it is set to 30 seconds by default. Values < 20 seconds are not recommended.