Author Archives: SmartFoxServer Team

Load Balancing SmartFoxServer 2X with HAProxy

In this article we are going to explore several ways to use the open source HAProxy load balancer in conjunction with SFS2X, to increase the scalability and availability of a multiplayer project.

We are going to show different configurations for TCP and Websocket connections and several ways to setup the system for common use cases.

To get the most out of this tutorial we require a basic knowledge of what a Load Balancer is and how it works, and some familiarity with the basics of networking and the OSI Model.

Continue reading

SFS2X memory settings and garbage collection (part 2)

In our previous chapter we have talked about the JVM memory configuration: when to use the defaults and when it might be necessary to fine tune the settings. We also touched on potential side effects of manual tuning and how it can sometimes backfire, for example, forcing the Garbage Collector (GC) to work harder.

In the second part of this series we are taking a look at the different Garbage Collectors available, which is the best for a specific use case, and when it’s useful to switch to a different implementation.

Continue reading

Using a database in Overcast (part 3)

In the third (and last) part of this series we are taking a look at using the JDBC API to access a database via SFS2X Extensions. While this approach takes a bit more coding compared to the DBManager API (which we have explored in part 2) it also provides more sophisticated features such as working with metadata and advanced data types.

Continue reading

Using a database in Overcast (part 2)

In the previous installment of the this tutorial we have learned all the steps to create a database server in Overcast and connect to it from an existing SFS2X instance.

In this new chapter we are going to explore the database API that can be used to query the database from server side, using SFS2X Extensions.

If you are new to server side coding we highly recommend to get started with this article from our documentation, before proceeding with the rest of the tutorial.

Continue reading

SFS2X memory settings and garbage collection (part 1)

When running SmartFoxServer on machines with large amounts of RAM (e.g. 32/64GB or more) developers often have questions about strategies to make use of all resources, and how to optimize garbage collection.

At first these questions can seem intimidating, considering the vast amount of custom settings available for the Java Runtime and the multiple garbage collection options, each with its own set of configuration choices.

The good news is that navigating the complexity of the JVM is easier and less intimidating than expected (at least for SFS2X devs) and with this article we hope to simplify most SmartFoxServer users’ life.

Continue reading

Using a database in Overcast (part 1)

In this new article in the series dedicated to Overcast, the cloud solution for SmartFoxServer 2X, we will describe how to use a database server alongside SmartFoxServer.

In this first part of the article we will focus on launching the database, populating it with some test data and configuring SmartFoxServer to connect to it. In the second and third parts we will deploy an Extension in SmartFoxServer to test the connection with a query.

Continue reading

Running multiple SFS2X instances (Tomcat edition)

For those interested in running multiple SFS2X instances on the same machine we have a short guide on how to setup each server correctly avoiding port conflicts.

In particular since SFS2X 2.14 we have switched from Jetty to Tomcat for the HTTP-related services and our previous article on the same topic no longer applies.

Continue reading