Production Server Howto Deploy Guide

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
Sigtran
Posts: 56
Joined: 10 Mar 2011, 15:54
Location: Ireland

Production Server Howto Deploy Guide

Post by Sigtran »

Hi, Im close to the stage of deploying a first production server, but it seems like there no guide of what should be taken out of the available server image (I have searched and the only things I found are related to extensions and examples from the original download). I would appreciate if someone points out to what should NOT be on the production server and how to achieve it. Im especially looking for things like how to turn off debugging, turn on flood filtering, whatever else there is.
I know I can do these I have mentioned, but I would appreciate if someone posts a complete list, as I may miss something and I would not want to fail because of the server configs.
Also would like to see an optimization guide somewhere for servers running only sfs and bare minimum of other processes with X amount of RAM/CPU/Connection
Thank you.
P.S. surprised that there is no production-ready version of sfs2x....
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

This a good suggestion and we will add it to our todo list.
In the meanwhile...

Highly recommended:

- Remove useless / demo zones
- Setup proper Admin account + IP restrictions (if needed)
- Properly configure permissions in your active Zones
- Properly configure the DBManager connection pool, don't just take the default values for granted ( if a DB is used )
- Turn off debugging features if active, and set log level to INFO or WARN
- Turn off Extension monitor
- Properly configure the basic Zone settings, found under the "General Tab" in the ZoneConfigurator

Optional:

- Setup a Word Filter, the related rules and dictionary of valid/invalid words
- Configure a Flood Filter to strenghten the server resilience against malicious attacks
- Fine tune the JVM memory settings, where necessary (e.g. increase the heap memory settings)
- Configure the Emailer service in order to send emails from your extension
Paolo Bax
The SmartFoxServer Team
Sigtran
Posts: 56
Joined: 10 Mar 2011, 15:54
Location: Ireland

Post by Sigtran »

Thanks bax, Ill probably have to ask a few more questions as im doing it in the next couple of weeks, Im going to document everything, so Ill release the steps Ive taken afterwords.
xLite
Posts: 106
Joined: 05 May 2010, 12:42

Post by xLite »

Can you be more specific as to what you mean by "Properly configure the DBManager connection pool, don't just take the default values for granted ( if a DB is used )"?

Thanks :)
Sigtran
Posts: 56
Joined: 10 Mar 2011, 15:54
Location: Ireland

Post by Sigtran »

@xLite
you can change the number of connections via admin tool.
xLite
Posts: 106
Joined: 05 May 2010, 12:42

Post by xLite »

Sigtran wrote:@xLite
you can change the number of connections via admin tool.
Thanks but your reply doesn't help at all.
Sigtran
Posts: 56
Joined: 10 Mar 2011, 15:54
Location: Ireland

Post by Sigtran »

xLite wrote: Thanks but your reply doesn't help at all.
Sorry, what I meant by change the number of connections is:
In the sfs2x admin tool, in the zone cofigurator, double click the zone, go to Database Manager. There you will see Maximum number of active and idle connections - change that number to whatever your database is comfortable with and whatever is necessary to have to keep the game running smoothly.

You will need to configure the database itself to be bale to take at least that number of connections and set it up, so the timeout is either very long or no timeout at all.
Here is a pic of where its set up in the admin tool:
http://docs2x.smartfoxserver.com/Gettin ... wtos#item2

I will be releasing the doc with step-by step of what I have done before going live, probably within the next two weeks, once I get the license sorted and do a bit of testing.
Sigtran
Posts: 56
Joined: 10 Mar 2011, 15:54
Location: Ireland

Post by Sigtran »

@bax
Im wondering, what is the right way to increase JVM heap size?
I know I can add -Xms -Xmx -Xmn to sfs2x-service manually, but im not sure if thats what I should do.
Also what would be the right values for the above and thread pool sizes for a VPS running with 4 processors & 16GB of RAM fully dedicated to SFS?
Thanks.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

There's no golden rule. It really depends on several things: application type, what your extension does and how much memory it uses, traffic.
The only way to determine is by checking the frequency of garbage collection at runtime and adjust the settings when necessary.

A few basic tips:

- don't be tempted to use tons of heap memory. In most cases 512MB-1GB is enough
- Increase heap in small steps, 256MB at a time for example.
Lapo
--
gotoAndPlay()
...addicted to flash games
Sigtran
Posts: 56
Joined: 10 Mar 2011, 15:54
Location: Ireland

Post by Sigtran »

Thanks Lapo,
should I directly manipulate sfs2x-service file to get the values I want, or is there another way?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

No other way, use those settings you mentioned in your previous post.
Paolo Bax
The SmartFoxServer Team
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Post by aaulia »

Hmm could somebody tell me how to tune the VM parameters ? Do I edit it from sfs2x-service file ? If so which variable should I change :-?
Sigtran
Posts: 56
Joined: 10 Mar 2011, 15:54
Location: Ireland

Post by Sigtran »

@ aaulia

yes, its sfs2x-service file.
you need to edit line 13-14, here is an example:

Code: Select all

# Uncomment the following line to add additional VM parameters
INSTALL4J_ADD_VM_PARAMS="-server -Xms1G -Xmx1G" 

add more parameters / change them / do whatever else you feel like.

P.S. btw I didnt make any step-guide, as it was so simple to tune sfs and Bax covers it all in his list
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Post by aaulia »

@Sigtran: thanks man, well now SFS2X RC3 already have this option nice and tidy in the AdminTools, but I still stumble into a problem. You see I tried setting my -Xm? setting to the following

-Xms128m
-Xmx512m
-Xmn128m

after that I could not restart/start the server, because the JVM is complaining about "Too small initial heap for new size specified"

can someone please share his/her vm options that you use :-/ just for testing/example sake
Post Reply