
Untitled
By: a guest on
Feb 26th, 2012 | syntax:
None | size: 0.63 KB | hits: 29 | expires: Never
# OpenVZ lower memory utilization, according to
# http://wiki.openvz.org/UBC_systemwide_configuration#.E2.80.9CLow_memory.E2.80.9D_.28x86_32_specific.29
#
# AWK script to calculate lower memory utilization
lowmem() {
awk '$1 ~ /kmemsize|tcprcvbuf|tcpsndbuf|dgramrcvbuf|othersockbuf/ { M+=$2 } END { print M / (0.4 * 832 * 1024 * 1024 ) }' $*
}
# Reading user bean counters, low mem usage is: 0.137789
lowmem /proc/user_beancounters
# Reading all resources files in /proc/bc, low mem usage is: 0.372573
lowmem /proc/bc/*/resources
# Only counting running containers, low mem usage is: 0.288026
lowmem /proc/bc/{101..108}/resources