[Ovirt-devel] [PATCH node] Changed how max swap size is calculated.
Alan Pevec
apevec at gmail.com
Wed Jan 14 21:37:57 UTC 2009
On Wed, Jan 14, 2009 at 8:08 PM, Darryl L. Pierce <dpierce at redhat.com>wrote:
>
> If overt_overcommit is not present, then the default value used is 1.5.
>
overt -> ovirt - or should we rename the project to make spell-checkers
happy? :)
default should be 0.5 to get Dor's 150% - where 100% is real RAM and the
rest is in swap
# if we didn't find any devices using HAL, so check for virtual devices
> - if [ -z $devices ]; then devices=$(ls -l /dev/[shv]d?); fi
> + if [ -z "$devices" ]; then devices=$(ls -l /dev/[shv]d?); fi
>
please push that as a separate commit, otherwise we'll be confused few
months from now when running git blame
> +if [ -z "$OVIRT_OVERCOMMIT" ]; then OVIRT_OVERCOMMIT="1.5"; fi
>
0.5
> SWAP_SIZE=${OVIRT_VOL_SWAP_SIZE:-$MEM_SIZE}
>
if OVIRT_VOL_SWAP_SIZE is defined, it should be used w/o changes, we don't
try to correct admin input,
so above line should come last
> +if [ $SWAP_SIZE -gt $MAX_SWAP_SIZE ]; then
> + SWAP_SIZE=$MAX_SWAP_SIZE
> +fi
> +
> +# add to the swap the amounts from
> http://kbase.redhat.com/faq/docs/DOC-15252
> +# convert mem size to GB
> +mgb=$(echo "scale=0; $MEM_SIZE/1024;" | bc -l)
> +if [ $mgb -le 4 ]; then
> + SWAP_SIZE=2
> +elif [ $mgb -le 16 ]; then
> + SWAP_SIZE=4
> +elif [ $mgb -le 64 ]; then
> + SWAP_SIZE=8
> +else
> + SWAP_SIZE=16
> +fi
> +
> +SWAP_SIZE=$(echo "scale=0; ${SWAP_SIZE} * 1024;" | bc -l)
>
> + # ovirt_overcommit
> + # set the swap size coefficient
> + overcommit=1.5
>
0.5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090114/5ec2330a/attachment.htm>
More information about the ovirt-devel
mailing list