Skip to content

ConfigurationServer

Max S edited this page Aug 31, 2015 · 10 revisions

Server Configuration

Overview

This page describes server configuration variables that are loaded from configuration files. All of the slave server types have their own configuration files (named "hserver.<type>.cfg"). There is a separate configuration file for cache server ("cacheserver.cfg") and there is another one for uniserver mode ("uniserver.cfg").

Slave server configuration file

The Snipe server uses separate configuration file for each defined type of slave servers available. There should always be a game server with type "game" and its configuration will be stored in "hserver.game.cfg" file in the server runtime folder.

Note that the default values are set for development purposes. The production server will need to use at least the recommended value to handle the load but the values will change depending on the amount of available resources.

* Rcm Val = Recommended Value

Configuration variable Default value Rcm Val Description
cache.update 5 60 Delay in seconds until the data blocks are updated with changes on cache server.
cacheserver.host 127.0.0.1 - Cache server host IP address.
cacheserver.port 2000 - Cache server port.
meta.servers 1 4 Amount of separate servers to start on this metaserver.
server.compression 0 1 Enables Gzip message compression.
server.compressionLevel 0 3 1-9. Sets message compression level.
server.externalHost Empty string - External server host IP address. Will be displayed in [[server list
server.externalPort 0 - External server port. Will be displayed in [[server list
server.host 127.0.0.1 - Server host IP address. Will be used in [[server list
server.logTime 1 0 Enables logging of time spent handling client requests.
server.loadLocalization 1 1 Enables loading of localization strings from database.
server.maxSocketsPerThread 512 1024 Number of connected sockets per network thread. Maximum number of connected sockets is calculated as meta.servers * server.receiveThreads * server.maxSocketsPerThread.
server.name Empty string - Server name.
server.port 2010 - Server port. Will be used in [[server list
server.printLog 1 0 Enables printing log to stdout.
server.receiveThreads 1 3 Number of network threads per metaserver.
server.serializeThreads 1 6 Amount of threads used to serialize and compress messages to clients. That amount is per metaserver.
server.urlThreads 1 16 Amount of URLRequester threads. Each main server thread has a separate instance of URL requester. This limits the amount of simultaneosly handled HTTP requests to server.urlThreads * meta.servers.
server.writeLog 1 1 Enables writing log to log files.
sns.KGapiKey Kongregate API key. Needed only if you intend to login to Kongregate SNS.

Cache server configuration file

The cache server uses a separate configuration file named "cacheserver.cfg".

Note that you should never open cache server to external connections!

Configuration variable Default value Recommended Value Description
cache.remove 60 120 Delay in seconds until the unchanged and unlocked data block is removed from memory. This number should be greater than cache.save.
cache.save 5 60 Delay in seconds until the changes in block are saved to database.
database.host localhost localhost Database connection host address string.
database.name Empty string - Database name.
database.password Empty string - Database password.
database.port 5432 5432 Database port.
database.user Empty string - Database user.
server.compression 0 0 If enabled, will use Gzip compression on server to server traffic. Unused in uniserver mode.
server.compressionLevel 0 0 1-9. Compression level.
server.host 127.0.0.1 127.0.0.1 Cache server IP address.
server.logTime 1 0 Enables logging of time spent handling slave server requests.
server.port 2000 - Server port.
server.printLog 1 0 Enables printing log to stdout.
server.receiveThreads 4 64 Total number of slave server handling threads. Should be greater than total number of slave server connections + some connections for the editor, website or scripts.
server.writeLog 1 1 Enables writing log to log files.

Uniserver configuration file

Uniserver configuration file is stored in "uniserver.cfg" and is used to load separate configuration files for different metaservers and/or disable them.

server.disabled.XXX = 1 line will disable the whole XXX metaserver type described in UniServer.slaveInfos. This is sometimes useful during the development.

server.XXX0 = hserver.XXX.0.cfg, server.XXX1 = hserver.XXX.1.cfg, etc will allow uniserver to start multiple metaservers of type XXX with different configuration files.