Go to file
Zhi Yan Liu 797d101a64 Resolving the performance issue for image listing of v2 API
According to my diagnosis [1], currently v2 API client consumed a lot
of CPU times by JSON schema validation on image model initialization
stage for image listing case. Because each image entry will triggers
one validation operation which spent most CPU clocks. (My test env has
1002 image entries now, so it's O(N) logic obviously).

This fix changed the original logic, it doesn't validate each image
entry but do it only on first image entry for each page. This approach
is a trade-off, it balanced the data validity and performance.

As comparison [3], under the fixed new logic, the execution time of
image listing is about four times as fast as old logic.

[1]
Clock type: CPU
Ordered by: totaltime, desc
name                                  ncall ttot
..nt/v2/images.py:34 Controller.list  1003  12.08480
../warlock/core.py:30 image.__init__  1002  11.91074
..warlock/model.py:28 image.__init__  1002  11.90463
..arlock/model.py:130 image.validate  1002  11.73838
..nschema/validators.py:388 validate  1002  11.73682

[2]
name                                  ncall ttot
..nt/v2/images.py:35 Controller.list  1003  1.100710
..nceclient/v2/images.py:45 paginate  256.. 1.099965
../warlock/core.py:30 image.__init__  1002  0.944762
..warlock/model.py:28 image.__init__  1002  0.939725
..arlock/model.py:130 image.validate  51    0.779653
..nschema/validators.py:388 validate  51    0.779431

[3]
$ time glance --os-image-api-version 2 image-list | grep 'test-' | wc -l
1000
real	0m16.606s
user	0m10.629s
sys	0m2.540s

$ time glance --os-image-api-version 2 image-list | grep 'test-' | wc -l
1000
real	0m4.151s
user	0m1.080s
sys	0m0.092s

Change-Id: Ia6598d3c06a5ff516277053c2b6fa5db744fe9cf
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2014-07-08 15:21:07 +08:00
2014-06-30 11:33:34 +02:00
2014-06-30 08:52:31 +00:00
2013-02-06 16:47:06 +02:00
2013-12-04 08:09:58 +00:00
2012-04-03 20:50:44 -06:00
2013-01-16 18:39:18 -05:00
2014-07-01 15:01:36 +08:00
2013-11-11 10:52:07 -08:00
2012-03-26 22:48:48 -07:00
2013-02-07 05:10:08 -06:00
2014-04-28 18:23:46 +02:00
2014-06-25 09:17:45 +00:00
2013-06-22 16:00:26 +02:00
2014-06-30 08:53:29 +02:00
2014-04-30 02:46:18 +00:00
2014-05-20 16:42:10 +02:00

Python bindings to the OpenStack Images API

This is a client library for Glance built on the OpenStack Images API. It provides a Python API (the glanceclient module) and a command-line tool (glance). This library fully supports the v1 Images API, while support for the v2 API is in progress.

Development takes place via the usual OpenStack processes as outlined in the OpenStack wiki. The master repository is on GitHub.

See release notes and more at http://docs.openstack.org/developer/python-glanceclient/.

Description
OpenStack Image Management (Glance) Client
Readme 18 MiB
Languages
Python 99.7%
Shell 0.3%