| Summary: | RBD Python bindings script is taking 3x more time to import a file as compare to RBD cli | ||
|---|---|---|---|
| Product: | Red Hat Ceph Storage | Reporter: | Vikhyat Umrao <vumrao> |
| Component: | RBD | Assignee: | Jason Dillaman <jdillama> |
| Status: | CLOSED NOTABUG | QA Contact: | ceph-qe-bugs <ceph-qe-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 1.3.3 | CC: | akaris, anharris, ceph-eng-bugs, wlehman |
| Target Milestone: | rc | ||
| Target Release: | 4.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-09-06 18:10:27 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | 1389529, 1647041, 1919160 | ||
| Bug Blocks: | |||
|
Description
Vikhyat Umrao
2016-10-26 21:32:44 UTC
- To avoid the zero block stuff we created a file of 9.3G and 1G with /dev/urandom and reproduced once again and it is mostly same the only difference is now rbd cli is not have same performance as it is taking whole file in consideration. ------------------------------------- - I created a 9.3G tesfile with /dev/urandom # du -sh /etc/ceph/testfile 9.3G /etc/ceph/testfile # time rbd --id=glance --image-format=2 --order=23 -p images import /etc/ceph/testfile testfile.rbd.cli Importing image: 100% complete...done. real 1m41.499s user 0m7.554s sys 0m9.129s # rbd info images/testfile.rbd.cli rbd image 'testfile.rbd.cli': size 9462 MB in 1183 objects order 23 (8192 kB objects) block_name_prefix: rbd_data.1743a3f238e1f29 format: 2 features: layering flags: ^^ rbd cli which was taking 20 seconds now it is taking 1 minute 41 seconds. But python binding is nearly same. # time python image-upload.py testfile.rbd.python.bindings /etc/ceph/testfile 8 [......] Writing data at offset 9873391616(MB: 9416) Writing data at offset 9881780224(MB: 9424) Writing data at offset 9890168832(MB: 9432) Writing data at offset 9898557440(MB: 9440) Writing data at offset 9906946048(MB: 9448) Writing data at offset 9915334656(MB: 9456) done real 4m4.008s user 0m4.093s sys 0m6.611s # rbd info images/testfile.rbd.python.bindings rbd image 'testfile.rbd.python.bindings': size 9462 MB in 1183 objects order 23 (8192 kB objects) block_name_prefix: rbd_data.1763af9238e1f29 format: 2 features: layering flags: ----------------------------- For 1G file: ------------ # du -sh /etc/ceph/testfile.1G 1.0G /etc/ceph/testfile.1G # time rbd --id=glance --order=23 --image-format=2 -p images import /etc/ceph/testfile.1G testfile.rbd.cli.1G Importing image: 100% complete...done. real 0m11.504s user 0m0.870s sys 0m1.432s # rbd info images/testfile.rbd.cli.1G rbd image 'testfile.rbd.cli.1G': size 1024 MB in 128 objects order 23 (8192 kB objects) block_name_prefix: rbd_data.176787e238e1f29 format: 2 features: layering flags: # time python image-upload.py testfile.rbd.python.bindings.1G /etc/ceph/testfile.1G 8 [.....] Writing data at offset 1031798784(MB: 984) Writing data at offset 1040187392(MB: 992) Writing data at offset 1048576000(MB: 1000) Writing data at offset 1056964608(MB: 1008) Writing data at offset 1065353216(MB: 1016) done real 0m26.687s user 0m0.578s sys 0m0.816s # rbd info images/testfile.rbd.python.bindings.1G rbd image 'testfile.rbd.python.bindings.1G': size 1024 MB in 128 objects order 23 (8192 kB objects) block_name_prefix: rbd_data.17678ab238e1f29 format: 2 features: layering flags: --------------------------------------------------------- There are two factors are play: (1) the rbd CLI will skip zeroed, object-size extents and (2) the rbd CLI uses aio to have 10 concurrent read/write requests in flight concurrently (controlled by the "rbd concurrent management ops" config value). Therefore, this BZ is not comparing apples to apples. Hi Jason! Well, for users, the end result is important. Glance is leveraging the python bindings, and we needed to know where this performance difference came from. Thanks for the explanation! How could one increase the concurrency of the python bindings? Would this be an RFE for the library code, or should the user of python rbd bindings somehow take care of the threading to create concurrent read/write requests in the application code? Meaning that this should be improved in glance's code? (In reply to Andreas Karis from comment #3) > Hi Jason! Well, for users, the end result is important. Glance is leveraging > the python bindings, and we needed to know where this performance difference > came from. Thanks for the explanation! How could one increase the > concurrency of the python bindings? Would this be an RFE for the library > code, or should the user of python rbd bindings somehow take care of the > threading to create concurrent read/write requests in the application code? > Meaning that this should be improved in glance's code? Hey Andreas, I had discussion with Jason and right we need to Open a RFE to enhance the glance RBD driver code for import to make use of concurrency. Created RFE agains glance https://bugzilla.redhat.com/show_bug.cgi?id=1389529 |