[Pacemaker] Making utilizations dynamic

Michael Schwartzkopff misch at clusterbau.com
Thu Jan 20 17:02:25 EST 2011


Hi,

I read about the utilization feature in beekhofs blog. Really nice. But why do 
not take the next step and make the utilization in resources dynamic since RAM 
or CPU usage will change with time.

For a demonstration I used a cluster node with utilization of 100 ticks 
(normal one core machine):

node node1 \
        utilization ticks="100"

Next I configured a slightly modified Dummy resource starting with 10 ticks 
utilization:

primitive resDummy1 ocf:misch:Dummy \
        op monitor interval="10s" \
        utilization ticks="10"

To test the whole feature I used placement-strategy="minimal", of course.

In the monitor part of my Dummy-RA I added:

        old=$(crm resource utilization $OCF_RESOURCE_INSTANCE show ticks)
        actual=$(cat /tmp/new.data)
        new=$(( (4*$old + $actual)/5 ))
        ocf_log info "old = "$old" actual = "$actual" new = "$new
        crm resource utilization $OCF_RESOURCE_INSTANCE set ticks $new


Please note that there is a kind of hysteresis feature included in the lines 
above. Changes in the utilization will not instantaneous appear in the 
resource but gradually.

Measuring the actual utilization of time ticks I use the file /tmp/new.data 
where I can enter numbers for testing. I real life I would do something like

PID=$( get the pid to the process in question)
new=$(top -n1 -p $PID -b | awk '/$PID/ {print $9}')

Testing my dynamic utilization feature you can write "200" into the 
/tmp/new.data file. The utilization value of the resource will gradually 
increase with every monitoring and when the value reaches the limit of "100" 
the resource will stop working on the node.

writing back "10" into the file you can watch the utilization fall again and 
finally being started on the node again.

Imagine the consequences for a cloud cluster consisting of 30 nodes hosting 
100 virtual machines. All machines would be migrated to the least possible 
number of real machines during the night when there no work to do. In the next 
morning when work starts virtual machines would be migrated to free machines 
when the work load gradually increases.

The only thing to do that remains would be a daemon that switches off unused 
machines to save energy. But this could be done using STONITH agents.

Basically this would be an option to make cloud computing really green!

Please mail me your comments about this idea. Thanks.

Cheers,

-- 
Dr. Michael Schwartzkopff
Guardinistr. 63
81375 München

Tel: (0163) 172 50 98
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.clusterlabs.org/pipermail/pacemaker/attachments/20110120/9106ddbb/attachment-0002.sig>


More information about the Pacemaker mailing list