Changes

Jump to: navigation, search

Setting UBC parameters

66 bytes removed, 02:52, 19 June 2010
Are you aware of a script that would run as a cron job and do the OOM math on a regular basis and email me if I've hit the red zone or maybe at 85-90%?
<pre>
#!/bin/bash
# Version 0.56
# Reference: http://wiki.openvz.org/Setting_UBC_parameters
# Author: Roberto Blandino Cisneros.
# Each container get a number if you have three
# containers e.g. eva gira huna
# Depending of the order they are ar shown in
# /proc/user_beancounters that number of position
# will be taken.
# If you want to see all values of the vm uncomment this
#cat head -$val /proc/user_beancounters | head -$val | tail -24
# The math start here.
# you must read carefully the page http://wiki.openvz.org/Setting_UBC_parameters
# the only thing i do was to get the values explained already there.
kmemsize=`cat head -$val /proc/user_beancounters | head -$val | tail -24 | head -1 | tail -1 | awk '{print $3}'` oomguarpages=`cat head -$val /proc/user_beancounters | head -$val | tail -24 | head -9 | tail -1 | awk '{print $2}'` tcpsndbuf=`cat head -$val /proc/user_beancounters | head -$val | tail -24 | head -14 | tail -1 | awk '{print $2}'` tcprcvbuf=`cat head -$val /proc/user_beancounters | head -$val | tail -24 | head -15 | tail -1 | awk '{print $2}'` othersockbuf=`cat head -$val /proc/user_beancounters | head -$val | tail -24 | head -16 | tail -1 | awk '{print $2}'` dgramrcvbuf=`cat head -$val /proc/user_beancounters | head -$val | tail -24 | head -17 | tail -1 | awk '{print $2}'` oomguarpages_barrier=`cat head -$val /proc/user_beancounters | head -$val | tail -24 | head -9 | tail -1 | awk '{print $4}'`
# We need to calculate three current values:
# We show the container ID and Percentage
echo `cat head -$val /proc/user_beancounters | head -$val | tail -24| head -1 | awk -F: '{print $1}'`" Status: "$porc"%"
# We show the two important values.
echo -e "System Count:\t-\tOOM Barrier:"
Anonymous user

Navigation menu