heat event-list is really slow

Bug #1195793 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Liang Chen

Bug Description

On my system (SSD equipped laptop), with one example stack generating 21 events on launch, it takes over 5 seconds to to heat event-list.

It seems this is because we're doing a request to nova for availability zones for every single event. I guess we need a smarter way to cache this...

# time heat event-list as108

+--------------------------+-----+------------------------+--------------------+----------------------+
| logical_resource_id | id | resource_status_reason | resource_status | event_time |
+--------------------------+-----+------------------------+--------------------+----------------------+
| ElasticLoadBalancer | 796 | state changed | CREATE_IN_PROGRESS | 2013-06-28T15:57:57Z |
| CfnUser | 800 | state changed | CREATE_IN_PROGRESS | 2013-06-28T15:57:58Z |
| CfnUser | 805 | state changed | CREATE_COMPLETE | 2013-06-28T15:57:59Z |
| WebServerKeys | 806 | state changed | CREATE_IN_PROGRESS | 2013-06-28T15:57:59Z |
| WebServerKeys | 807 | state changed | CREATE_COMPLETE | 2013-06-28T15:58:00Z |
| LaunchConfig | 810 | state changed | CREATE_IN_PROGRESS | 2013-06-28T15:58:01Z |
| LaunchConfig | 811 | state changed | CREATE_COMPLETE | 2013-06-28T15:58:01Z |
| ElasticLoadBalancer | 815 | state changed | CREATE_COMPLETE | 2013-06-28T16:00:25Z |
| WebServerGroup | 816 | state changed | CREATE_IN_PROGRESS | 2013-06-28T16:00:25Z |
| ElasticLoadBalancer | 817 | state changed | UPDATE_IN_PROGRESS | 2013-06-28T16:00:40Z |
| ElasticLoadBalancer | 818 | state changed | UPDATE_COMPLETE | 2013-06-28T16:00:40Z |
| WebServerGroup | 819 | state changed | CREATE_COMPLETE | 2013-06-28T16:00:40Z |
| WebServerScaleDownPolicy | 822 | state changed | CREATE_IN_PROGRESS | 2013-06-28T16:00:40Z |
| WebServerScaleUpPolicy | 820 | state changed | CREATE_IN_PROGRESS | 2013-06-28T16:00:40Z |
| WebServerScaleUpPolicy | 821 | state changed | CREATE_COMPLETE | 2013-06-28T16:00:40Z |
| WebServerScaleDownPolicy | 823 | state changed | CREATE_COMPLETE | 2013-06-28T16:00:41Z |
| MEMAlarmHigh | 825 | state changed | CREATE_IN_PROGRESS | 2013-06-28T16:00:42Z |
| MEMAlarmLow | 824 | state changed | CREATE_IN_PROGRESS | 2013-06-28T16:00:42Z |
| MEMAlarmHigh | 826 | state changed | CREATE_COMPLETE | 2013-06-28T16:00:43Z |
| MEMAlarmLow | 827 | state changed | CREATE_COMPLETE | 2013-06-28T16:00:43Z |
+--------------------------+-----+------------------------+--------------------+----------------------+

real 0m5.430s
user 0m0.252s
sys 0m0.046s

Steven Hardy (shardy)
Changed in heat:
milestone: none → havana-3
status: New → Triaged
importance: Undecided → Medium
Liang Chen (cbjchen)
Changed in heat:
assignee: nobody → Liang Chen (cbjchen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/36001

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/36001
Committed: http://github.com/openstack/heat/commit/3fa39dd2ccc9013cfba4ec8bd5fb79caeba0350e
Submitter: Jenkins
Branch: master

commit 3fa39dd2ccc9013cfba4ec8bd5fb79caeba0350e
Author: Liang Chen <email address hidden>
Date: Sun Jul 7 14:43:45 2013 +0800

    avoid excessive database calls while loading events

    list_events constructs Event objects through Event.load, which causes
    every event record previously loaded into memory to be reloaded again.
    Furthermore, Event.load will also reload the associated stack, thus
    all its resources and template. Another bad thing with that is
    reloading a stack will lead to many extra stack static resolution
    (including calls to nova to resovle Fn::GetAZs if it's referenced in
    the template).

    Fixes bug #1195793

    Change-Id: I4f14c9a2a4f990b753a6e1405e27eb44c53537c9

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.