[openstack-dev] Python overhead for rootwrap

Joe Gordon joe.gordon0 at gmail.com
Fri Jul 26 20:59:17 UTC 2013

On Fri, Jul 26, 2013 at 11:34 AM, Jay Pipes <jaypipes at gmail.com> wrote:

> On 07/25/2013 04:21 PM, Joe Gordon wrote:
>> Hi All,
>> We have recently hit some performance issues with nova-network.  It
>> turns out the root cause of this was we do roughly 20 rootwrapped shell
>> commands, many inside of global locks.
>> (https://bugs.launchpad.net/**oslo/+bug/1199433<https://bugs.launchpad.net/oslo/+bug/1199433>
>> )
>> It turns out starting python itself, has a fairly significant overhead
>> when compared to the run time of many of the binary commands we execute.
>> For example:
>> $ time python -c "print 'test'"
>> test
>> real0m0.023s
>> user0m0.016s
>> sys0m0.004s
>> $ time ip a
>> <...>
>> real0m0.003s
>> user0m0.000s
>> sys0m0.000s
>> While we have removed the extra overhead of using entry points, we are
>> now hitting the overhead of just shelling out to python.
> Hey Joe,
> Just ask a question of you personally, off list... I was curious about the
> above statement about entry points. Could you elaborate a bit there? I
> thought OpenStack had moved *to* using entry points with stevedore?

Turns out this wasn't off the list.  So I will answer on the list.

I am not sure about how stevadore fits into this, but the issue is related
to 'import pkg_resources' and how the binaries are built from the 'cmd'
files.   It looks like nova doesn't use stevadore for that (yet?). It turns
out pkg_resources scans your entire python environment in part to make it
possible to have multiple versions of packages installed, but it looks like
pip doesn't support that anyway so it just slows things down and provides
us no benefit.

You can see the issue by going into devstack and running "time python -c
'import pkg_resouces'"

This thread may shine more light on what we saw:

Not sure if that helps.

> Did this change recently?
> Best,
> -jay
> ______________________________**_________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.**org <OpenStack-dev at lists.openstack.org>
> http://lists.openstack.org/**cgi-bin/mailman/listinfo/**openstack-dev<http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130726/6988b22c/attachment.html>

More information about the OpenStack-dev mailing list