Kmaiti

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, 5 May 2010

Automatic adjustment of Container

Posted on 18:29 by Unknown
Automatic adjustment

FIXME: vzcfgvalidate -r|-i

-r Enter the correction mode to fix the wrong resources configuration.
-i Enter the interactive correction mode.
Read More
Posted in | No comments

MLAT/cpulimit/cpuunits

Posted on 18:29 by Unknown
http://wiki.openvz.org/User_Guide/Managing_Resources#Managing_CPU_Share //Referred

Resource control VPS :

The root cause of this problem was high "MLAT" value in his container
(as shown by vzstat). This was happening due to this resource setting
of his VPS: cpulimit = 50% & cpus = 4. I have now changed his cpulimit
to 400%. After some research, I found that cpulimit works on PER-CPU
basis. So, for 1 CPU, cpulimit = 100% means "fully use 1 CPU". But
when you have 4 CPUs, you must specify cpulimit = 400% to "fully use
ALL 4 CPUs".

So, if there are 16 CPUs , cpulimit = 1600% ie CPULIMIT = 1600 "fully use
ALL 16 CPUs".

=====
processor at HW Node : 4 (2000.304Mhz each, 1024 KB cache, Dual-Core AMD), 7 GB RAM , 1 GB SWAP
No of processor at Each CT : 1 (each CT RAM = 1 GB)
So, each CT should have CPULIMITS =100, for 4 processor it'll be 400
BURST_CPULIMIT="0" //for each CT

=========

[root@node3 scripts]#for i in `vzlist | awk '{print $1 }'`; do grep CPULIMIT /etc/vz/conf/$i.conf; done //command to check CPUlimit of the container.

Tune CTs :

[root@node3 conf]# for i in `vzlist -a| awk '{print $1 }'`; do sed -i -e 's/CPULIMIT="0"/CPULIMIT="1600"/g' /etc/vz/conf/$i.conf; done
[root@node3 conf]# for i in `vzlist -a| awk '{print $1 }'`; do sed -i 's/BURST_CPULIMIT="1600"/BURST_CPULIMIT="0"/g' /etc/vz/conf/$i.conf; done

[root@node3 conf]#for i in `vzlist -a|grep stopped | awk '{print $1 }'`; do sed -i -e 's/CPUS="0"/CPUS="16"/g' /etc/vz/conf/$i.conf; done

[root@node4 log]# for i in `vzlist -a|awk '{print $1 }'`; do sed -i -e 's/CPUS="2"/CPUS="16"/g' /etc/vz/conf/$i.conf; done


check cpuunits in node and containers :

vzcpucheck and

for i in `vzlist | awk '{print $1 }'`; do grep CPUUNITS /etc/vz/conf/$i.conf; done

=========
In the following example, Container 102 is guaranteed to receive about 2% of the CPU time even if the Hardware Node is fully used, or in other words, if the current CPU utilization equals the power of the Node. Besides, CT 102 will not receive more than 4% of the CPU time even if the CPU is not fully loaded:

# vzctl set 102 --cpuunits 1500 --cpulimit 4 --save
Configuring Number of CPUs Inside Container : # vzctl set 101 --cpus 2 --save

========

primary parameter :


avnumproc
The average number of processes and threads.
V
numproc
The maximal number of processes and threads the CT may create.
V
numtcpsock
The number of TCP sockets (PF_INET family, SOCK_STREAM type). This parameter limits the number of TCP connections and, thus, the number of clients the server application can handle in parallel.
V
numothersock
The number of sockets other than TCP ones. Local (UNIX-domain) sockets are used for communications inside the system. UDP sockets are used, for example, for Domain Name Service (DNS) queries. UDP and other sockets may also be used in some very specialized applications (SNMP agents and others).
V
vmguarpages
The memory allocation guarantee, in pages (one page is 4 Kb). CT applications are guaranteed to be able to allocate additional memory so long as the amount of memory accounted as privvmpages (see the auxiliary parameters) does not exceed the configured barrier of the vmguarpages parameter. Above the barrier, additional memory allocation is not guaranteed and may fail in case of overall memory shortage.

============

How is the values currentlu used bu CT ?

vzctl exec 101 cat /proc/user_beancounters
Monitoring Memory Consumption
You can monitor a number of memory parameters for the whole Hardware Node and for particular Containers with the help of the vzmemcheck utility. For example:
# vzmemcheck -v -A //in Megabyte
Read More
Posted in | No comments

Validating Container Configuration(VPS)

Posted on 18:28 by Unknown
Validating Container Configuration : -

# vzcfgvalidate /etc/vz/conf/101.conf

The utility checks constraints on the resource management parameters and displays all the constraint violations found. There can be three levels of violation severity:
Recommendation >> This is a suggestion, which is not critical for Container or Hardware Node operations. The configuration is valid in general; however, if the system has enough memory, it is better to increase the settings as advised.
----------
Warning >>A constraint is not satisfied, and the configuration is invalid. The Container applications may not have optimal performance or may fail in an ungraceful way.
----------
Error >> An important constraint is not satisfied, and the configuration is invalid. The Container applications have increased chances to fail unexpectedly, to be terminated, or to hang.
----------
Read More
Posted in | No comments

Monitoring Memory Consumption

Posted on 18:27 by Unknown
Monitoring Memory Consumption :

You can monitor a number of memory parameters for the whole Hardware Node and for particular Containers with the help of the vzmemcheck utility. For example:

# vzmemcheck -v
Read More
Posted in | No comments

Monitor resources usage of VPS

Posted on 18:26 by Unknown
1. Monitoring System Resources Consumption :

It is possible to check the system resource control parameters statistics from within a Container. The primary use of these statistics is to understand what particular resource has limits preventing an application to start. Moreover, these statistics report the current and maximal resources consumption for the running Container. This information can be obtained from the /proc/user_beancounters file.

command #vzctl exec 101 cat /proc/user_beancounters


The failcnt column displays the number of unsuccessful attempts to allocate a particular resource. If this value increases after an application fails to start, then the corresponding resource limit is in effect lower than is needed by the application.

The held column displays the current resource usage, and the maxheld column – the maximal value of the resource consumption for the last accounting period. The meaning of the barrier and limit columns depends on the parameter and is explained in the UBC guide.

Inside a CT, the /proc/user_beancounters file displays the information on the given CT only, whereas from the Hardware Node this file displays the information on all the CTs.
Read More
Posted in | No comments

Managa VPS resources :

Posted on 18:25 by Unknown
7. Managing Container CPU resources :-
The current section explains the CPU resource parameters that you can configure and monitor for each Container.

The table below provides the name and the description for the CPU parameters. The File column indicates whether the parameter is defined in the OpenVZ global configuration file (G) or in the CT configuration files (V).

parameter Description File
======================================================
A)ve0cpuunits >> determines the minimal guaranteed share of the CPU time Container 0 (the Hardware Node itself) will receive. It is recommended to set the value of this parameter to be 5-10% of the power of the Hardware Node(commadn to show power of node :vzcpucheck). After the Node is up and running, you can redefine the amount of the CPU time allocated to the command : Node by using the --cpuunits parameter with the vzctl set 0 command. >> G
B)cpuunits >> This is a positive integer number that determines the minimal guaranteed share of the CPU time the corresponding Container will receive. >> V

C)cpulimit >> This is a positive number indicating the CPU time in per cent the corresponding CT is not allowed to exceed. >> V

D ) cpus >>The number of CPUs to be used to handle the processes running inside the corresponding Container.
>> V

==========


8. Managing CPU Share : -The OpenVZ CPU resource control utilities allow you to guarantee any Container the amount of CPU time this Container receives. The Container can consume more than the guaranteed value if there are no other Containers competing for the CPU and the cpulimit parameter is not defined.

Note: The CPU time shares and limits are calculated on the basis of a one-second period. Thus, for example, if a Container is not allowed to receive more than 50% of the CPU time, it will be able to receive no more than half a second each second.

To get a view of the optimal share to be assigned to a Container, check the current Hardware Node CPU utilization:


# vzcpucheck =========>>>
Current CPU utilization: 5166
Power of the node: 73072.5

The output of this command displays the total number of the so-called CPU units(ie 5166 seconds) consumed by all running Containers and Hardware Node processes. Power of the node: 429892 , this is the max no of seconds unites of this node can perform.

Besides, CT 102 will not receive more than 4% of the CPU time even if the CPU is not fully loaded:

# vzctl set 102 --cpuunits 1500 --cpulimit 4 --save
Saved parameters for CT 102
# vzctl start 102
Starting CT …
CT is mounted
Adding IP address(es): 192.168.1.102
CT start in progress…
# vzcpucheck
Current CPU utilization: 6667
Power of the node: 73072.5

To set the --cpuunits parameter for the Hardware Node, you should indicate 0 as the Container ID (e.g. vzctl set 0 --cpuunits 5000 --save).

==============================


9. Configuring Number of CPUs Inside Container : -


If your Hardware Node has more than one physical processor installed, you can control the number of CPUs which will be used to handle the processes running inside separate Containers. By default, a Container is allowed to consume the CPU time of all processors on the Hardware Node, i.e. any process inside any Container can be executed on any processor on the Node. However, you can modify the number of physical CPUs which will be simultaneously available to a Container using the --cpus option of the vzctl set command. For example, if your Hardware Node has 4 physical processors installed, i.e. any Container on the Node can make use of these 4 processors, you can set the processes inside Container 101 to be run on 2 CPUs only by issuing the following command:

# vzctl set 101 --cpus 2 --save

Note: The number of CPUs to be set for a Container must not exceed the number of physical CPUs installed on the Hardware Node. In this case the 'physical CPUs' notation designates the number of CPUs the OpenVZ kernel is aware of (you can view this CPU number using the cat /proc/cpuinfo command on the Hardware Node).

=============================

10 : Managing System Parameters :

The resources a Container may allocate are defined by the system resource control parameters. These parameters can be subdivided into the following categories: primary, secondary, and auxiliary parameters. The primary parameters are the start point for creating a Container configuration from scratch. The secondary parameters are dependent on the primary ones and are calculated from them according to a set of constraints. The auxiliary parameters help improve fault isolation among applications in one and the same Container and the way applications handle errors and consume resources. They also help enforce administrative policies on Containers by limiting the resources required by an application and preventing the application to run in the Container.

Listed below are all the system resource control parameters. The parameters starting with «num» are measured in integers. The parameters ending in «buf» or «size» are measured in bytes. The parameters containing «pages» in their names are measured in 4096-byte pages (IA32 architecture). The File column indicates that all the system parameters are defined in the corresponding CT configuration files (V).

==
Primary parameters Parameter Description File
avnumproc >> The average number of processes and threads. V
numproc >> The maximal number of processes and threads the CT may create. V
numtcpsock >> The number of TCP sockets (PF_INET family, SOCK_STREAM type). This parameter limits the number of TCP connections and, thus, the number of clients the server application can handle in parallel. V
numothersock >> The number of sockets other than TCP ones. Local (UNIX-domain) sockets are used for communications inside the system. UDP sockets are used, for example, for Domain Name Service (DNS) queries. UDP and other sockets may also be used in some very specialized applications (SNMP agents and others). V
vmguarpages >> The memory allocation guarantee, in pages (one page is 4 Kb). CT applications are guaranteed to be able to allocate additional memory so long as the amount of memory accounted as privvmpages (see the auxiliary parameters) does not exceed the configured barrier of the vmguarpages parameter. Above the barrier, additional memory allocation is not guaranteed and may fail in case of overall memory shortage. V
------------------------

Secondary parameters Parameter Description File
kmemsize >> The size of unswappable kernel memory allocated for the internal kernel structures for the processes of a particular CT. V
tcpsndbuf >> The total size of send buffers for TCP sockets, i.e. the amount of kernel memory allocated for the data sent from an application to a TCP socket, but not acknowledged by the remote side yet. V
tcprcvbuf >> The total size of receive buffers for TCP sockets, i.e. the amount of kernel memory allocated for the data received from the remote side, but not read by the local application yet. V
othersockbuf >> The total size of UNIX-domain socket buffers, UDP, and other datagram protocol send buffers. V
dgramrcvbuf >> The total size of receive buffers of UDP and other datagram protocols. V
oomguarpages >> The out-of-memory guarantee, in pages (one page is 4 Kb). Any CT process will not be killed even in case of heavy memory shortage if the current memory consumption (including both physical memory and swap) does not reach the oomguarpages barrier. V

---------------------

Auxiliary parameters Parameter Description File
lockedpages >> The memory not allowed to be swapped out (locked with the mlock() system call), in pages. V
shmpages >> The total size of shared memory (including IPC, shared anonymous mappings and tmpfs objects) allocated by the processes of a particular CT, in pages. V
privvmpages >> The size of private (or potentially private) memory allocated by an application. The memory that is always shared among different applications is not included in this resource parameter. V
numfile >>The number of files opened by all CT processes. V
numflock >>The number of file locks created by all CT processes. V
numpty >>The number of pseudo-terminals, such as an ssh session, the screen or xterm applications, etc. V
numsiginfo >> The number of siginfo structures (essentially, this parameter limits the size of the signal delivery queue). V
dcachesize >> The total size of dentry and inode structures locked in the memory. V
physpages >> The total size of RAM used by the CT processes. This is an accounting-only parameter currently. It shows the usage of RAM by the CT. For the memory pages used by several different CTs (mappings of shared libraries, for example), only the corresponding fraction of a page is charged to each CT. The sum of the physpages usage for all CTs corresponds to the total number of pages used in the system by all the accounted users. V
numiptent >> The number of IP packet filtering entries. V

You can edit any of these parameters in the /etc/vz/conf/CTID.conf file of the corresponding Container by means of your favorite text editor (for example, vi or emacs), or by running the vzctl set command. For example:

# vzctl set 101 --kmemsize 2211840:2359296 --save
Saved parameters for CT 101

======================
Read More
Posted in | No comments

Virtuzoo commands

Posted on 18:24 by Unknown
[root@test /]#vzctl start/stop/restart 101 // start the VPS 101
[root@test /]#vzctl enter 101 // enter into 101 VPS
[root@101 /]#exit // log out from 101 VPS
[root@test /]#vzlist // display the list of active VPS’s
[root@test /]#vzlist -a // display the list of all VPS’s
[root@test /]#vzcalc -v 101 // show resources usage on VPS
[root@test /]#vzctl exec 101 df -m // execute commands against the VPS(in this case ‘df -m’)
[root@test /]#vzyum 101 -y install package // install package using yum on VPS
[root@test /]#vzrpm 101 -Uvh package // install package using rpm on VPS
vzstat
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • [a fatal error or timeout occurred while processing this directive] + cpanel
    Guys, Just check the cpanel log file and you'll get the clue from there. I got following messages : execute : tail -f /usr/local/cpanel/...
  • How to access the webalizer from the outside of the cpanel?
    Guys, I don't want to post this type of article since you'll get it from the Google. But still I did. I followed following steps : E...
  • How to enable php in apache on RHEL ?
    1. In order to enable php engine in apache, you should make sure php is installed in the system first. Then refer following steps : locate l...
  • WHM + http showing failed ?
    Guys, Please check the log of the apache server like : 1. tail -f /usr/local/apache/logs/error_log 2. check the http port in /usr/local/apac...
  • How do I determine if my x86-compatible Intel system is multi-processor, multi-core or supports hyperthreading?
    Guys, We need to know about multi-processor, multi-core or supports hyperthreading. Here are the details : Physical ID (Physical processor o...
  • Addition, multiplication etc in bash script?
    ======== #!/bin/bash x=5 # initialize x to 5 y=3 # initialize y to 3 add=$(($x + $y)) # add the values of x and y and assign it to va...
  • How to install phpshield on 32 or 64 bit linux machine?
    Guys, phpSHIELD protects your PHP Source Code with a powerful, easy to use encoder, which creates a native bytecode version of the script an...
  • Directory structure of Qmail :-
    [root@ds1130 var]# tree qmail/ | grep [a-zA-Z] qmail/ |-- alias |-- bin | |-- autoresponder | |-- bouncesaying | |-- cmd5checkpw | |...
  • NDMP communication failure error
    Guys, Issue : Netbackup server sends alert NDMP communication failure once everyday. But there is no issue to run scheduled backup jobs. Env...
  • make: *** [install-webconf] Error 1
    Guys, I got this error message during configuring the nagios : Here is the exact error message. ======= root@server [/usr/local/src/nagios-3...

Categories

  • ACL
  • ESX
  • Linux
  • Storage
  • UCS

Blog Archive

  • ▼  2013 (5)
    • ▼  May (1)
      • NDMP communication failure error
    • ►  April (3)
    • ►  February (1)
  • ►  2012 (10)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
    • ►  March (3)
    • ►  February (3)
    • ►  January (1)
  • ►  2011 (86)
    • ►  December (3)
    • ►  November (2)
    • ►  September (19)
    • ►  August (9)
    • ►  July (5)
    • ►  June (9)
    • ►  May (12)
    • ►  April (3)
    • ►  March (4)
    • ►  February (5)
    • ►  January (15)
  • ►  2010 (152)
    • ►  December (9)
    • ►  November (34)
    • ►  October (20)
    • ►  September (14)
    • ►  August (24)
    • ►  July (19)
    • ►  June (3)
    • ►  May (25)
    • ►  April (3)
    • ►  January (1)
Powered by Blogger.