Metadata cache time should be configurable

Bug #1366139 reported by Chris St. Pierre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Chris St. Pierre

Bug Description

The nova metadata request handler uses an in-memory cache of 15 seconds. Under very heavy usage of the metadata service, this can drastically limit the cache hit rate, since it expires so quickly.

Adding the ability to control the cache timeout has, in our tests, increased the average cache hit rate from around 20% to 80% or better with approximately a thousand metadata calls per minute.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: nobody → Chris St. Pierre (stpierre)
status: New → In Progress
Revision history for this message
Sean Dague (sdague) wrote :

Question, do you think that there is a better default than 15s? Especially in your experience in the environments you've got. I think 15s was probably arbitrary and upping the default is probably sane.

Changed in nova:
importance: Undecided → Medium
Revision history for this message
Chris St. Pierre (stpierre) wrote :

I don't think we have any particular guidance for that; we have a couple of customers who hit the metadata service *really* hard, so making this tunable is important, but the default mostly seems to Just Work.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Chris St. Pierre (<email address hidden>) on branch: master
Review: https://review.openstack.org/119421
Reason: I'm going to roll this into a bigger spec to use oslo.cache to provide a true shared cache for the metadata API in Kilo.

Changed in nova:
status: In Progress → Confirmed
Changed in nova:
status: Confirmed → In Progress
Changed in nova:
status: In Progress → Confirmed
Joe Gordon (jogo)
Changed in nova:
importance: Medium → Wishlist
importance: Wishlist → Medium
Changed in nova:
assignee: Chris St. Pierre (stpierre) → Nicolas Simonds (nicolas.simonds)
status: Confirmed → In Progress
Changed in nova:
assignee: Nicolas Simonds (nicolas.simonds) → Chris St. Pierre (stpierre)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/159264
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5a93bfd484ec8402f906f13fefd4d03f04426d99
Submitter: Jenkins
Branch: master

commit 5a93bfd484ec8402f906f13fefd4d03f04426d99
Author: Chris St. Pierre <email address hidden>
Date: Wed Feb 25 15:52:34 2015 -0600

    Make metadata cache time configurable

    The metadata cache expiration is now a config option.

    New Option:
    metadata_cache_expiration - Default 15
        Time in seconds to cache metadata objects.

    This also adds basic unit tests for the MetadataRequestHandler, which
    might be nice to have.

    Co-Authored-By: Chet Burgess <email address hidden>
    Co-Authored-By: Nicolas Simonds <email address hidden>
    DocImpact
    Closes-Bug: 1366139
    Change-Id: I4e829ec52cf1445339f325b5895987c82dc7a8f4

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-3 → 2015.1.0
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.