這兒 寫出一段話,
UBC is the major component of OpenVZ resource management.
想必這一定是OpenVZ裡,資源管理最重要的一環了
就讓我們提心吊膽的往下看吧~
#cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
101: kmemsize 836919 1005343 2752512 2936012 0
lockedpages 0 0 32 32 0
privvmpages 4587 7289 49152 53575 0
shmpages 39 39 8192 8192 0
dummy 0 0 0 0 0
numproc 20 26 65 65 0
physpages 2267 2399 0 2147483647 0
vmguarpages 0 0 6144 2147483647 0
oomguarpages 2267 2399 6144 2147483647 0
numtcpsock 3 3 80 80 0
numflock 3 4 100 110 0
numpty 1 1 16 16 0
numsiginfo 0 1 256 256 0
tcpsndbuf 0 0 319488 524288 0
tcprcvbuf 0 0 319488 524288 0
othersockbuf 6684 7888 132096 336896 0
dgramrcvbuf 0 8372 132096 132096 0
numothersock 8 10 80 80 0
dcachesize 87672 92168 1048576 1097728 0
numfile 238 306 2048 2048 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 10 16 128 128 0
http://openvz.org/UBC_parameters
http://openvz.org/Proc/user_beancounters
這裡寫到了所有細節,基本上這裡列出了101這個container的資源使用情況及限制可取用資源~
held:目前資源的使用量
maxheld:在此虛擬機器生命周期中,曾經發生過的最大的使用量
barrier:與資源控制設定有關,用來設定限制或保證資源的取得
limit:與資源控制設定有關,用來設定限制或保證資源的取得
failcnt:在此虛擬機器生命周期中,資源取得配置失敗的次數總計
通常情況下,barrier不會超出limit
估計藉由收集這些數值來觀察來設計、調整資源的運用。
完美的情況應該是maxheld不會超出limit和barrier,不然應會出現failcnt。
能得到逼近系統maxheld的barrier及limit,才是完美的配置情況吧。
在系統資源允許的情況下,加點空間增加系統的可用性也是種好方式。
將資源分三種群組:主要參數、次要參數、輔助參數的定義
http://openvz.org/UBC_parameters_table
不是很好懂、+-看囉~
Name | Description | 大概的意義(未完,需考證) |
---|---|---|
Primary parameters | ||
numproc | Maximum number of processes and kernel-level threads allowed for this container. | 這個container中允許有多少個程序、核心層線程 |
numtcpsock | Maximum number of TCP sockets. | 最大量的TCP Sockets |
numothersock | Maximum number of non-TCP sockets (local sockets, UDP and other types of sockets). | 最大量的非TCP Sockets |
vmguarpages | Memory allocation guarantee. | 保證記憶體配置 |
Secondary parameters | ||
kmemsize | Size of unswappable kernel memory, allocated allocated for processes in this container. | 無法交換的核心記憶體的大小 |
tcpsndbuf | Total size of buffers used to send data over TCP network connections. | 用來傳送TCP連線資料使用的緩衝區大小 |
tcprcvbuf | Total size of buffers used to temporary store the data coming from TCP network connections. | 用來接收TCP連線資料使用的緩衝區大小 |
othersockbuf | Total size of UNIX-domain socket buffers, UDP and other datagram protocol send buffers. | 用來傳送UDP還有其它datagram協定的緩衝區大小 |
dgramrcvbuf | Receive buffers of UDP and other datagram protocols. | 用來接收UDP還有其它datagram協定的緩衝區大小 |
oomguarpages | The guaranteed amount of memory for the case the memory is “over-booked” (out-of-memory kill guarantee). |
保證可擁有多少記憶體當記憶體用完時 |
privvmpages | Memory allocation limit, in pages. | 記憶體配置的最大量,單位Page |
Auxiliary parameters | ||
lockedpages | Process pages not allowed to be swapped out (pages locked by mlock(2) ). |
不允許交換的程序頁(locked page) |
shmpages | Total size of shared memory (IPC, shared anonymous mappings and tmpfs objects), in pages. |
共享的記憶體大小,單位Page |
physpages | Total number of RAM pages used by processes. | 所有程序所使用的記憶體量,單位Page |
numfile | Number of open files. | 有多少檔案被打開中 |
numflock | Number of file locks. | 有多少檔案被鎖住 |
numpty | Number of pseudo-terminals. | 終端機數量? |
numsiginfo | Number of siginfo structures. |
siginfo結構的數量? |
dcachesize | Total size of dentry and inode structures locked in memory. |
鎖在記憶體中的dentry 和inode 結構的總大小? |
numiptent | Number of NETFILTER (IP packet filtering) entries. | netfilter項目的數量(IP封包過濾)? |
swappages | Amount of swap space to show in container. | 在container中交換空間的總量? |
詳細的解釋在這兒~
http://openvz.org/UBC_primary_parameters
http://openvz.org/UBC_secondary_parameters
http://openvz.org/UBC_auxiliary_parameters
設定的值是有一些相關性需要遵循的~
http://openvz.org/UBC_consistency_check
http://openvz.org/UBC_interdependencies_table
http://openvz.org/UBC_systemwide_configuration
http://openvz.org/UBC_parameter_properties