[openstack-dev] profiling nova-api

Stephen Gran stephen.gran at guardian.co.uk
Wed Mar 20 18:00:53 UTC 2013


Hi,

I'm looking at nova-api in folsom, at the moment.  Performance is really 
rather slow, and I'm curious about a few things.

The particular thing I'm chasing down is metadata server performance (8 
seconds for a lookup for a VM seems rather slow to me - the database 
queries are only taking 10s of milliseconds, according to postgres).

When doing a fast printf profile, I can see that several seconds are 
spent in nova/network/quantumv2/api.py collecting network info for the 
instance.  Changing the quantum client to be cached (self.qclient = ... 
and so on) cut the overall query time from 8 seconds to 6.  I assume 
there will be similar gains in the glance lookups, but I haven't done 
that yet.

So, this leads me to a couple of questions:

Why is the client recreated in each method instead of cached?  I assume 
this is because 'context' will change across calls?  Can this not be 
made at least slightly better with some logic like:

def _get_qclient(self, context):
     if context != self.context or not self.qclient:
         self.qclient = ....
         self.context = context
     return self.qclient

And then in the methods, call 'client = self._get_client(context)'

(I don't know - I'm sure there's a good reason why it is the way it is 
now, so I'm asking).

Also, it seems that applications aren't caching their keystone tokens, 
leading to lots and lots of calls to keystone to get new ones, when the 
old ones are good for hours yet.  Is there a reason the authtokens 
aren't cached and reused?  I can see it might be awkward, but we do at 
least potentially have memcached handy.

I have looked to see if it looks like this is changing in Grizzly, but I 
don't see changes like this, so I thought I'd ask.

Cheers,
-- 
Stephen Gran
Senior Systems Integrator - guardian.co.uk
Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - website of the year
 
www.guardian.co.uk    www.observer.co.uk     www.guardiannews.com 
 
On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad 
 
Save up to 32% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access. 
Visit guardian.co.uk/subscribe
 
---------------------------------------------------------------------
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.
 
Guardian News & Media Limited
 
A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP
 
Registered in England Number 908396




More information about the OpenStack-dev mailing list