Page 1 of 1

Production Server Howto Deploy Guide

Posted: 06 May 2011, 09:36
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....

Posted: 07 May 2011, 08:00
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

Posted: 09 May 2011, 07:03
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.

Posted: 09 May 2011, 14:43
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 :)

Posted: 09 May 2011, 18:15
by Sigtran
@xLite
you can change the number of connections via admin tool.

Posted: 09 May 2011, 19:39
by xLite
Sigtran wrote:@xLite
you can change the number of connections via admin tool.
Thanks but your reply doesn't help at all.

Posted: 11 May 2011, 10:22
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.

Posted: 16 May 2011, 12:50
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.

Posted: 17 May 2011, 13:02
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.

Posted: 17 May 2011, 13:09
by Sigtran
Thanks Lapo,
should I directly manipulate sfs2x-service file to get the values I want, or is there another way?

Posted: 17 May 2011, 14:19
by Bax
No other way, use those settings you mentioned in your previous post.

Posted: 27 Jun 2011, 09:20
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 :-?

Posted: 27 Jun 2011, 09:59
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

Posted: 01 Jul 2011, 07:33
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