#  Copyright (C) 2000-2007 SWsoft. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# This is a modification of the OpenVZ 'B' Sample Configuration. The
# modifications are:
#
# An increase in the KMEMSIZE parameter to about 4.2MB
# An increase in the TCPRCVBUF parameter to 479232:786432
# An increase in the NUMFILE parameter to 3000
#
# The file and buffers increases are needed to make apt-get
# work correctly and the incease in kmemsize allows 
# dpkg to work.
#
# The increase in kmemsize would be a problem in a 32 bit machine
# since all kernel memory is allocated from "low memory" or
# ZONE_NORMAL and this is limited to a max of 860MB.  However,
# on a machine with 64bit processor(s) and AMD64 Linux all
# 64GB of RAM is "low memory" so we have plenty.

# Parameter format:
#
# The first number is the "barrier" and the second number is the "limit".
# The barrier should never exceed the limit but the two often are 
# equal if the parameter in question requires then to be.
#
# Parameters with "guar" in the names are guaranters.
#
# Unit of measure for memory parameters is 4KB pages.  So common
# values are:
#
#  6144 = 25MB RAM
# 12288 = 50MB RAM
# 24576 = 100MB RAM
# 49152 = 200MB RAM
# 61440 = 250MB RAM



VERSION="2"
ONBOOT="yes"



# UBC parameters (in form of barrier:limit)


# Primary parameters

# Average number of processes.  The barrier should 
# be set equal to the limit
AVNUMPROC="40:40"

# Maximum number of processes and kernel-level threads
# for this VPS.  The barrier should be set equal to the limit.
NUMPROC="65:65"

# Maximum number of TCP sockets.  The barrier should be set
# equal to the limit.  Although there are no direct limits to the
# number of TCP sockets, the number needs to be controlled 
# because each socket uses some memory for rx and tx buffers. See
# also parameters tcpsndbuf and tcprcvbuf.
NUMTCPSOCK="80:80"

# Maximum number of non-TCP sockets (local sockets, UDP and other types).
# The barrier should be set equal to the limit.
NUMOTHERSOCK="80:80"

# Memory allocation guarantee.  The limit of this parameter should
# be set to the maximum memory in the machine.  The docs say to set
# it to MAX_ULONG, which is 2^32-1 (2147483647) on 32bit machines
# and 2^24-1 (9223372036854775807) on 64bit machines. This
# parameter is closely related to the privvmpages parameter, which 
# actually sets limits on the amount of memory available to the VPS.
# The unit of measure is memory pages, 4kb on a 32 bit system and 
# unknown on a 64bit system.
#
# 6144 pages = 25MB RAM
VMGUARPAGES="6144:9223372036854775807"


# Secondary parameters
#
# All of these parameters are related to memory.  For oomguarpages and
# privvmpages units are in pages.  All other secondary paramters 
# have units in bytes.



# Size of unswappable memory, allocated by the operating system kernel.
# This parameter is related to parameter numproc.  Each process consumes
# at least 24KB but usually 30KB to 60KB.  A very large process can
# consume more.
#
# It is important to have a gap between barrier and limit.  10% is
# a good minimum gap. To caculate the barrier, multiply the numproc
# by 60KB (61440).  To caculate the limit, add another 10%.
#
# This parameter is in bytes.
KMEMSIZE="3892838:4282122"

# The value of this parameter is related to numtcpsock and should allow
# for 4000 bytes of memory per socket in the barrier.  To caculate the
# limit, make 

bI'+

bI'+


bI'+
bI'+
bI'+
bI'+
bI'+
bI'+
#
# lim - bar >= 2.5 * numtcpsock
TCPSNDBUF="319488:524288"

# The total size of buffers used to temporarily store the data coming 
# from TCP network connections. This parameter depends upon numtcpsock.
# Make sure the following equation is satisfied:
#
# lim - bar >= 2.4 * numtcpsock
TCPRCVBUF="1022361:1431306"

# The total size of buffers used by local (UNIX-domain) connections
# between processes inside the system and send buffers of UDP and 
# other datagram protocols.  This parameter depends on numothersock.
# Make sure the values satisfy this equation:
#
# lim - bar >= 2.5 * numothersock
OTHERSOCKBUF="132096:336896"

# The total size of buffers used to temporarily store the incoming pack
# of UDP and other datagram protocols.  This parameter depends upon
# numothersock. 
DGRAMRCVBUF="132096:132096"

# Guaranteed amount of memory for the case when the memory is
# "over-booked" (out-of-memory kill guarantee).  This parameter is
# related to vmguarpages.  
OOMGUARPAGES="6144:9223372036854775807"




# Auxiliary parameters

# Process pages not allowed to be swapped out. The barrier may be set
# equal to the limit or may allow some gap.  However, typical apps
# like web, ftp and mail servers don't use memory locking.
LOCKEDPAGES="32:32"

# The total size of shared memory.  The barrier should be set equal
# to the limit.
SHMPAGES="8192:8192"

# Memory allocation LIMIT.  This parameter controlls the upper boundary
# of the total size of allocated memory.  When normal priority allocation
# requests exceed the barrior they fail.  High priority allocation
# requests will continue past barrier but fail at limit.  This parameter
# does not guarantee barrier / limit amount of memory but rather limits
# the VPS to that amount.  To guarantee a minimum amount of memory, use
# vmguarpages. 
#
# This parameter deals with allocated memory, whether it is used or not.
# Some applications allocate memory they never use.
#
# There should be a safety gap between barrier and limit.  Units for this
# parameter are pages.
PRIVVMPAGES="22528:24576"

# Number of open files.  Set barrier equal to limit.
NUMFILE="3000:3000"

# Number of file locks.  Leave a gap between barrier and limit.
NUMFLOCK="100:110"

# Number of pseudo-terminals.  This is used to limit the number of
# simultanious sessions.  Set barrier equal to limit.
NUMPTY="16:16"

# Number of siginfo structures.  Set barrier equal to limit. 
NUMSIGINFO="256:256"

# The total size of dentry and inode structures locked in memory.
# Leave a gap between barrier and limit.
DCACHESIZE="524288:548864"

# Total number of RAM pages used by processes in this VPS.  This is
# an accounting only parameter, so set barrier to 0 and limit
# to MAX_ULONG.
PHYSPAGES="0:9223372036854775807"

# The number of NETFILTER (IP packet filtering) entries. Set the 
# barrier equal to the limit.
NUMIPTENT="128:128"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="1048576:1153434"
DISKINODES="200000:220000"
QUOTATIME="0"

# CPU fair sheduler parameter
CPUUNITS="1000"
OFFLINE_MANAGEMENT="yes"


VE_ROOT="/mnt/compvps/vz/root/$VEID"
VE_PRIVATE="/mnt/compvps/vz/private/$VEID"
OSTEMPLATE="debian-3.1-x86_64-minimal"
ORIGIN_SAMPLE="vps.b1"
HOSTNAME="vps5000.regtek.com"
IP_ADDRESS="72.46.65.254"
NAMESERVER="72.46.65.44"
  For oomguarpages and
# privvmpages units are in pages.  All other secondary paramters 
# have units in bytes.



# Size of unswappable memory, allocated by the operating system kernel.
# This parameter is related to parameter numproc.  Each process consumes
# at least 24KB but usually 30KB to 60KB.  A very large process can
# consume more.
#
# It is important to have a gap between barrier and limit.  10% is
# a good minimum gap. To caculate the barrier, multiply the numproc
# by 60KB (61440).  To caculate the limit, add another 10%.
#
# This parameter is in bytes.
KMEMSIZE="3892838:4282122"

# The value of this parameter is related to numtcpsock and should allow
# for 4000 bytes of memory per socket in the barrier.  To caculate the
# limit, make 

bI'+

bI'+


bI'+
bI'+
bI'+
bI'+
bI'+
bI'+
