2012-09-18 19:55:05 |
Russell Bryant |
description |
The following commit change image downloading to be asynchronous:
commit 41c164139cab619d0a3e0d97b80037f85eb541ad
Author: Eoghan Glynn <eglynn@redhat.com>
Date: Wed Sep 5 14:33:47 2012 +0000
Asynchronously copy from external image source
Fixes bug 1008874, bug 1046433.
Avoid tieing up dispatch thread for large copy-from images,
instead initiate copy asynchronously.
The response status is not set to 202 Accepted as per standard
RESTful idiom, as a non-error response code change requires
an API version bump.
Instead, the incomplete nature of the image registration is
reflected in the image status.
Change-Id: I06692422490de0a7d93f63bbd0ffb9c6435a0d2b
Unfortunately, it appears that there is a greenthread scheduling problem that still leaves glance-api in a bad state while the image is downloaded.
[rbryant@f17-openstack-test-day ~]$ time glance add name=f16 is_public=true disk_format=qcow2 container_format=bare copy_from=http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2
Added new image with ID: 9717656c-2564-4b15-812c-8706ca038d2c
real 0m0.715s
user 0m0.117s
sys 0m0.033s
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 1m11.992s
user 0m0.109s
sys 0m0.022s
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 1m1.287s
user 0m0.124s
sys 0m0.061s
(repeat 'time glance index' 4 more times, with times varying from 1 to 1.5 minutes)
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 0m24.255s
user 0m0.125s
sys 0m0.034s
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 0m0.443s
user 0m0.110s
sys 0m0.017s
(all further instances return quickly like this) |
The following commit changed image downloading when using copy_from to be asynchronous:
commit 41c164139cab619d0a3e0d97b80037f85eb541ad
Author: Eoghan Glynn <eglynn@redhat.com>
Date: Wed Sep 5 14:33:47 2012 +0000
Asynchronously copy from external image source
Fixes bug 1008874, bug 1046433.
Avoid tieing up dispatch thread for large copy-from images,
instead initiate copy asynchronously.
The response status is not set to 202 Accepted as per standard
RESTful idiom, as a non-error response code change requires
an API version bump.
Instead, the incomplete nature of the image registration is
reflected in the image status.
Change-Id: I06692422490de0a7d93f63bbd0ffb9c6435a0d2b
Unfortunately, it appears that there is a greenthread scheduling problem that still leaves glance-api in a bad state while the image is downloaded.
[rbryant@f17-openstack-test-day ~]$ time glance add name=f16 is_public=true disk_format=qcow2 container_format=bare copy_from=http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2
Added new image with ID: 9717656c-2564-4b15-812c-8706ca038d2c
real 0m0.715s
user 0m0.117s
sys 0m0.033s
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 1m11.992s
user 0m0.109s
sys 0m0.022s
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 1m1.287s
user 0m0.124s
sys 0m0.061s
(repeat 'time glance index' 4 more times, with times varying from 1 to 1.5 minutes)
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 0m24.255s
user 0m0.125s
sys 0m0.034s
[rbryant@f17-openstack-test-day ~]$ time glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
9717656c-2564-4b15-812c-8706ca038d2c f16 qcow2 bare 213581824
real 0m0.443s
user 0m0.110s
sys 0m0.017s
(all further instances return quickly like this) |
|