GameServer out of memory [message #1929] |
Wed, 08 March 2006 11:11 |
martin18
Messages: 2 Registered: March 2006 Location: nl
|
Junior Member |
|
|
Hello.
I am trying to run a cod2 game server with openvz. but i get a error from the game server (out of memory)
The server is 64bit software and has 2GB of memory.
What can i do ??
(sorry for my bad eng)
tanks Martin
-------------------
meminfo
MemTotal: 2050688 kB
MemFree: 10584 kB
Buffers: 3064 kB
Cached: 1743616 kB
SwapCached: 1260 kB
Active: 1147536 kB
Inactive: 730132 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 2050688 kB
LowFree: 10584 kB
SwapTotal: 2031608 kB
SwapFree: 2004872 kB
Dirty: 0 kB
Writeback: 0 kB
Mapped: 137808 kB
Slab: 145792 kB
Committed_AS: 312784 kB
PageTables: 2048 kB
VmallocTotal: 536870908 kB
VmallocUsed: 6336 kB
VmallocChunk: 18014398509481980 kB
-------------------
|
|
|
|
|
Re: GameServer out of memory [message #1936 is a reply to message #1934] |
Wed, 08 March 2006 17:50 |
martin18
Messages: 2 Registered: March 2006 Location: nl
|
Junior Member |
|
|
okay there is someting wrong ......
how to setup Beancounters ???
Version: 2.5
uid resource held maxheld barrier limit failcnt
1: kmemsize 3248554 5242876 5242880 5242880 57576330
lockedpages 0 0 32 32 0
privvmpages 5886 237787 262144 262144 52
shmpages 683 1979 8192 8192 0
dummy 0 0 0 0 0
numproc 18 33 80 100 0
physpages 3016 60573 32768 32768 0
vmguarpages 0 0 131072 131072 0
oomguarpages 3056 92402 32768 32768 0
numtcpsock 4 11 80 80 0
numflock 2 4 100 110 0
numpty 1 5 16 20 0
numsiginfo 0 10 256 256 0
tcpsndbuf 4672 109792 319488 524288 0
tcprcvbuf 0 328640 319488 524288 249
othersockbuf 2336 16608 132096 336896 0
dgramrcvbuf 0 13152 132096 132096 0
numothersock 4 18 80 80 0
dcachesize 154208 284992 1048576 1097728 0
numfile 238 522 1280 1280 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 10 10 128 128 0
[Updated on: Mon, 20 March 2006 06:28] by Moderator Report message to a moderator
|
|
|
Re: GameServer out of memory [message #2099 is a reply to message #1936] |
Mon, 20 March 2006 06:40 |
|
Here is a step-by-step instruction
(0) Start with the known working VPS config. It can be vps.basic config, you can apply it to a VPS using this command:
vzctl set VPSID --applyconfig vps.basic --save
(1) See /proc/user_beancounters if there are some beancounters for which failcnt>0. In your case this is kmemsize, privvmpages and tcprcvbuf. You need to increase them.
(2) For each beancounter you want to increase, take the current values of barrier and limit, and multiply it by some factor (e.g. 1.2 or 1.5 or 2 or 4). Apply the newly calculated values using this command:
vzctl set VPSID --beancounter newbarrier:newlimit --save
Please note that in most cases there should be a safety gap between a barrier and a limit.
(3) Check the resulting configuration using vzcfgvalidate:
vzcfgvalidate /etc/sysconfig/vz-scripts/VPSID.conf
If there are some errors or warnings -- fix them as suggested, or run vzcfgvalidate with -r switch to fix automatically.
(4) Notice the current value of failcnt for the parameter you have just increased. Try running your application in VPS again. Check if there is some problems in its log files. Check if failcnt is growing. If it is growing, go back to step 2.
(5) You should end up with your application fully working, without increasing failcnts for all the beancounters, and with a valid VPS config (vzcfgvalidate should not complain). To be sure, restart your VPS and check /proc/user_beancounters again. Then try to create some load for your application to check it works under load as well.
Kir Kolyshkin
|
|
|
Re: GameServer out of memory [message #2102 is a reply to message #1936] |
Mon, 20 March 2006 13:31 |
dev
Messages: 1693 Registered: September 2005 Location: Moscow
|
Senior Member |
|
|
This output shows that you have configured too tight resource restrictions for your VPS.
the last column in /proc/user_beancounters output shows you which resource was experiencing shortage.
in your case it is kmemsize, privvmpages, tcprcvbuf.
you can increase these limits using:
# vzctl set <VPSID> --kmemsize barrier:limit --save
# vzctl set <VPSID> --privvmpages barrier:limit --save
# vzctl set <VPSID> --tcprcvbuf barrier:limit --save
in your case I would try to increase it, something like this:
vzctl set 111 --kmemsize 10000000:11000000 --tcprcvbuf 5242880:5842880 --save
Also, check whether you game server has parameter which allows to limit its memory desires. I found the following parameters for cod2:
Quote: |
set com_hunkMegs "96" // Amount of memory dedicated to server
set com_zoneMegs "32" // File memory
|
here: http://www.codboards.com/lofiversion/index.php/t8798.html
[Updated on: Mon, 20 March 2006 13:37] Report message to a moderator
|
|
|