LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Optimizing for GameServers (https://www.linuxquestions.org/questions/linux-software-2/optimizing-for-gameservers-908202/)

snooze1 10-14-2011 01:07 PM

Optimizing for GameServers
 
Hello,

Currently I am hosting a game that requires a lot of RAM (hosted on CentOS 5.x x = latest), I am currently hosting on Xeons X3*** w/ 32GB of RAM, 1GBit uplink port. Placing around 30-60 servers on once box and still giving it 7-10GB's of room to breathe using around 50% avenged CPU usage. I am having little reports of lag with one player connected to their server, I was wondering how I would go about to optimize the kernal, if possible to enable the servers to run at a high priory, due to that is the only thing the server is actually hosting.

unSpawn 10-14-2011 06:48 PM

If it's more players experiencing problems then optimization may be in order. If it's just one best determine first if the source of latency is beyond your control or not IMHO.

jefro 10-14-2011 08:09 PM

I'd build my system from scratch or use at least gentoo as a base but unSpawn is right that the first step is to find the bottleneck.

snooze1 10-14-2011 11:07 PM

The thing is, I am using 32GB ECC DDR3, (BTW, gamservers are coded in Java). When running a server using the Xmx and Xms values, If a 1024MB server is created, it will use to 1024MB and allow no room for the players, or only allow around 4-5 connections before lag, yet with another host they allow 512MB's of RAM and it lets them connect with up to 10 players, thus I am using/have better server specifications.

snooze1 10-15-2011 08:17 PM

Bump

sag47 10-16-2011 04:12 AM

The lag may come from the program having to reallocate more memory every time it reaches a certain number of connections. You can increase allocated memory of the program with some JAVA_OPTS. The options you'd probably want are -Xms and -Xmx.

Just edit the JAVA_OPTS in the bash script for launching the game server.
Code:

JAVA_OPTS="$JAVA_OPTS -Xms3G -Xmx10G"
To preallocate 3GB of RAM and allow a max of 10GB to allocate. Make them whatever you want.

Maybe consider monitoring your machine with something like Icinga with PNP4Nagios or munin for historical data so that you can get a performance profile over time to see if the problem is a regular hick-up.

You should also consider using sun java instead of openjdk as it generally has better performance and more reliable at properly running Java programs.

SAM

snooze1 10-16-2011 04:41 AM

Quote:

Originally Posted by sag47 (Post 4499670)
The lag may come from the program having to reallocate more memory every time it reaches a certain number of connections. You can increase allocated memory of the program with some JAVA_OPTS. The options you'd probably want are -Xms and -Xmx.

Just edit the JAVA_OPTS in the bash script for launching the game server.
Code:

JAVA_OPTS="$JAVA_OPTS -Xms3G -Xmx10G"
To preallocate 3GB of RAM and allow a max of 10GB to allocate. Make them whatever you want.

Maybe consider monitoring your machine with something like Icinga with PNP4Nagios or munin for historical data so that you can get a performance profile over time to see if the problem is a regular hick-up.

You should also consider using sun java instead of openjdk as it generally has better performance and more reliable at properly running Java programs.

SAM

The thing is I am selling the RAM, that's how the gameservers are sold, so allowing more RAM for the server would defeat the purpose in having the fixed prices. The problem is when allocating say 1024MB linux will use all of it and allow no room, but with windows it will only use what it needs.


All times are GMT -5. The time now is 03:54 AM.