← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1383469] [NEW] InstanceList.get_active_by_window_joined only needs system_metadata for expected_attrs in simple-tenant-usage API

 

Public bug reported:

The os-simple-tenant-usage API queries the database over a given time
range (default is 1 month at most from Horizon and novaclient) and pulls
all instance information from the database for a given tenant.

As you add more instances, this API is going to take longer given the
joins required in the database for the instances table here:

http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/compute/contrib/simple_tenant_usage.py?id=2014.2#n142

However, the only join we really need there is on system_metadata when
getting the flavor information:

http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/compute/contrib/simple_tenant_usage.py?id=2014.2#n114

This means we're joining on these other tables unnecessarily:

INSTANCE_DEFAULT_FIELDS = ['metadata', 'system_metadata', 'info_cache',
'security_groups']

** Affects: nova
     Importance: Medium
     Assignee: Matt Riedemann (mriedem)
         Status: Triaged


** Tags: api performance

** Changed in: nova
       Status: New => Triaged

** Changed in: nova
     Assignee: (unassigned) => Matt Riedemann (mriedem)

** Changed in: nova
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1383469

Title:
  InstanceList.get_active_by_window_joined only needs system_metadata
  for expected_attrs in simple-tenant-usage API

Status in OpenStack Compute (Nova):
  Triaged

Bug description:
  The os-simple-tenant-usage API queries the database over a given time
  range (default is 1 month at most from Horizon and novaclient) and
  pulls all instance information from the database for a given tenant.

  As you add more instances, this API is going to take longer given the
  joins required in the database for the instances table here:

  http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/compute/contrib/simple_tenant_usage.py?id=2014.2#n142

  However, the only join we really need there is on system_metadata when
  getting the flavor information:

  http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/compute/contrib/simple_tenant_usage.py?id=2014.2#n114

  This means we're joining on these other tables unnecessarily:

  INSTANCE_DEFAULT_FIELDS = ['metadata', 'system_metadata',
  'info_cache', 'security_groups']

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1383469/+subscriptions


Follow ups

References