Ask Your Question
2

How do you setup autoscaling based on memory?

asked 2015-03-27 14:10:14 -0500

Jet gravatar image

updated 2015-03-30 15:20:16 -0500

On Github HOT examples we have an example of how to auto-scale based on cpu utilization. How would you do auto-scaling based on memory utilization? Nova compute is configured via Ceilometer install documentation i.e.

# nova-compute configuration for ceilometer
instance_usage_audit=True
instance_usage_audit_period=hour
notify_on_state_change=vm_and_task_state
notification_driver=nova.openstack.common.notifier.rpc_notifier

However I only have the memory meter i.e.

# ceilometer meter-list -q resource_id=52251682-3663-4533-9276-ca5e4d61d7d3
    +--------------------------+------------+-----------+
    | Name                     | Type       | Unit      |
    +--------------------------+------------+-----------+
    | cpu                      | cumulative | ns        |
    | cpu_util                 | gauge      | %         |
    | disk.ephemeral.size      | gauge      | GB        |
    | disk.read.bytes          | cumulative | B         |
    | disk.read.bytes.rate     | gauge      | B/s       |
    | disk.read.requests       | cumulative | request   |
    | disk.read.requests.rate  | gauge      | request/s |
    | disk.root.size           | gauge      | GB        |
    | disk.write.bytes         | cumulative | B         |
    | disk.write.bytes.rate    | gauge      | B/s       |
    | disk.write.requests      | cumulative | request   |
    | disk.write.requests.rate | gauge      | request/s |
    | instance                 | gauge      | instance  |
    | instance:linux.small     | gauge      | instance  |
    | memory                   | gauge      | MB        |
    | vcpus                    | gauge      | vcpu      |
    +--------------------------+------------+-----------+

# ceilometer statistics -m memory --period 60 -q resource_id=52251682-3663-4533-9276-ca5e4d61d7d3
    +--------+--------+--------+--------+---------+-------+----------+
    | Period | Max    | Min    | Avg    | Sum     | Count | Duration |
    +--------+--------+--------+--------+---------+-------+----------+
    | 60     | 2048.0 | 2048.0 | 2048.0 | 18432.0 | 9     | 8.408    |
    | 60     | 2048.0 | 2048.0 | 2048.0 | 4096.0  | 2     | 0.016    |
    | 60     | 2048.0 | 2048.0 | 2048.0 | 2048.0  | 1     | 0.0      |
    | 60     | 2048.0 | 2048.0 | 2048.0 | 2048.0  | 1     | 0.0      |
    +--------+--------+--------+--------+---------+-------+----------+

What else do I need to do to make so that there is memory usage as a meter?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2015-03-27 17:46:00 -0500

Scaling based on memory utilisation is not all that different - in the autostart.yaml example you linked, you'd use the 'memory' trigger rather than the 'cpu-util' trigger.

The difference is that Ceilometer doesn't really collect memory usage data by default - you'll need to enable instance usage auditing in your Nova config.

See the 'Configure Nova' section of the Ceilometer install guide:

http://docs.openstack.org/developer/c...

edit flag offensive delete link more

Comments

1

I do have that configured and I edited my post with that and what meters I do see right now. Thanks

Jet gravatar imageJet ( 2015-03-30 15:16:50 -0500 )edit
1

According to this compute metrics it looks like memory.usage isn’t in Libvirt until Kilo. Does that mean there isn't currently a way to do autoscaling based on memory utilization?

Jet gravatar imageJet ( 2015-04-01 13:20:56 -0500 )edit
1

Correct; if you're on Juno, you'll only see the memory.usage metric if you're using the Xen or vSphere virt backends.

tedlit gravatar imagetedlit ( 2015-04-01 14:36:47 -0500 )edit
1

had the same issue .So you have to use a command which creates and sends samples to Ceilometer. Here is a link with the command you need to use: http://docs.openstack.org/admin-guide-cloud/content/section_telemetry-post-api.html (http://docs.openstack.org/admin-guide...)

binou gravatar imagebinou ( 2015-05-07 10:09:20 -0500 )edit
1

@Jet: I have to do exactly the same thing. autoscalling based on memory. have you got any results so far?

ichi-the-one gravatar imageichi-the-one ( 2015-05-18 03:32:40 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-03-27 14:10:14 -0500

Seen: 600 times

Last updated: Mar 30 '15