Ask Your Question
0

ceilometer memory usage ratio dommemstat memory

asked 2016-07-27 02:05:29 -0500

openstack-eagle gravatar image

Can I get the memory usage ratio from ceilometer. I can get cpu_util use

[root@controller ~(keystone_admin)]# ceilometer sample-list -q resource=48afa90d-20e9-4096-8c5d-6543e49a03f7 -m cpu_util

+--------------------------------------+----------+-------+-----------------+------+----------------------------+ | Resource ID | Name | Type | Volume | Unit | Timestamp | +--------------------------------------+----------+-------+-----------------+------+----------------------------+ | 48afa90d-20e9-4096-8c5d-6543e49a03f7 | cpu_util | gauge | 0.128334366425 | % | 2016-07-27T06:46:53.043000 | | 48afa90d-20e9-4096-8c5d-6543e49a03f7 | cpu_util | gauge | 0.124997847537 | % | 2016-07-27T06:36:53.048000 |

I can also get memory usage:

[root@controller ~(keystone_admin)]# ceilometer sample-list -q resource=48afa90d-20e9-4096-8c5d-6543e49a03f7 -m memory.usage

+--------------------------------------+--------------+-------+--------+------+----------------------------+ | Resource ID | Name | Type | Volume | Unit | Timestamp | +--------------------------------------+--------------+-------+--------+------+----------------------------+ | 48afa90d-20e9-4096-8c5d-6543e49a03f7 | memory.usage | gauge | 206.0 | MB | 2016-07-27T06:46:53.072000 | | 48afa90d-20e9-4096-8c5d-6543e49a03f7 | memory.usage | gauge | 206.0 | MB | 2016-07-27T06:36:53.076000 |

If I want get the memory ratio like cpu util, I need get the total memory. Is this possible? I think the memory usage ratio would caculated as: memory.usage/total.

But when I loged in the vm created with 2G and use free , below is the dispaly:

[root@c7-az-nova ~]# free

          total        used        free      shared  buff/cache   available

Mem: 1884124 67112 1673108 16656 143904 1670240

Swap: 0 0 0

Does anyone know how the number total 1839 is caculate?

when use virsh dommemstat below is the display:

virsh # dommemstat 36

actual 2097152

swap_in 0

swap_out 0

major_fault 458

minor_fault 764818

unused 1673108

available 1884124

rss 2260280

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2016-07-28 04:43:33 -0500

yprokule gravatar image

updated 2016-08-01 01:00:14 -0500

@openstack-eagle, if U want to get 'memory_utilization' meter U can try to add next snippet to the pipeline.yaml

---
sources:
    - name: mem_util
      interval: 600
      meters:
          - "memory"
          - "memory.usage"
      sinks:
          - mem_utilization
sinks:
    - name: mem_utilization
      transformers:
          - name: "arithmetic"
            parameters:
                target:
                    name: "memory.usage"
                    unit: "%"
                    type: "gauge"
                    expr: "$(memory) / $(memory.usage)"
      publishers:
          - notifier://

Here is code of memory pollster so U can check how data is collected:

edit flag offensive delete link more

Comments

Hi yprokule, thanks for your reply. after configure, how can I get the data using the client?

I find the reason for less memory when I allocate 2G, actually get 1884124, ref: https://bbs.archlinux.org/viewtopic.p...

openstack-eagle gravatar imageopenstack-eagle ( 2016-07-31 21:51:58 -0500 )edit

@openstack-eagle, U can access data looking for the memory.usage meter. Or I'm missing the question?

yprokule gravatar imageyprokule ( 2016-08-01 01:02:07 -0500 )edit

@yprokule, U mean use: ceilometer -d sample-list -q resource=e797d368-a82a-4c30-af8e-1776bcf7b524 -m memory.usage?

openstack-eagle gravatar imageopenstack-eagle ( 2016-08-01 01:25:37 -0500 )edit

exactly. I believe resource_id is not changed though U can always check meter list and figure it out :)

yprokule gravatar imageyprokule ( 2016-08-01 01:55:13 -0500 )edit

I modify the pipiline.yaml and restart the service, but i can not see the result. the meter-list only show memory.resident and memory.usage. and the sample for memory.usage is the same as old, e797d368-a82a-4c30-af8e-1776bcf7b524 | memory.usage | gauge | 202.0 | MB | 2016-08-01T08:03:45.117000

openstack-eagle gravatar imageopenstack-eagle ( 2016-08-01 03:14:26 -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: 2016-07-27 02:05:29 -0500

Seen: 393 times

Last updated: Aug 01 '16