Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create disk is too slow #143

Open
swimfish09 opened this issue Jan 14, 2019 · 16 comments
Open

create disk is too slow #143

swimfish09 opened this issue Jan 14, 2019 · 16 comments

Comments

@swimfish09
Copy link

swimfish09 commented Jan 14, 2019

I have about 250 luns.
When i use curl to create new lun, it is cost about 51s, even it is about 1g disk.
Is there a way to repid this?
curl --insecure --user admin:admin -d mode=create -d size=1g -d pool=rbd_gw -X PUT http://10.142.90.34:8778/api/disk/rbd.zhouqi_test03

@swimfish09
Copy link
Author

What did ceph-iscsi-api do when i created a new lun?

@dillaman
Copy link

It's definitely not optimized for creating high numbers of LUNs -- the expected use-case would be just a handful of LUNs. I believe currently each LUN creation causes a full rescan of LIO's configfs filesystem, which will take exponentially more time as more LUNs are added.

@swimfish09
Copy link
Author

@dillaman can you give me some advices to optimize creating high numbers of LUNs?

@dillaman
Copy link

You can probably run it under the python profiler to see where it's spending all its time during a LUN addition.

@swimfish09
Copy link
Author

from the log processing cost a lot of time.

@swimfish09
Copy link
Author

Now processing is serial, Can i change it to parallel?

@dillaman
Copy link

I'd imagine the real problem is that it is doing unnecessary work when adding a new disk (e.g. perhaps it's reconfiguring all existing disks when adding a new LUN). It just needs to be investigated. Of course, I also would give far warning that with hundreds of disks, you are running in a "unique" configuration that probably won't see too much testing.

@mikechristie
Copy link
Contributor

@swimfish09

Does every lun creation take about 50 seconds or the later ones?

Were you using a lot of gateways and if so do you have this patch:
61ec575

@swimfish09
Copy link
Author

@mikechristie the later ones.
I use two gateways.

@swimfish09
Copy link
Author

swimfish09 commented Jan 16, 2019

@dillaman Now rtslib-fb allow creating more than 256 LUNs per target, hundreds of disks will be common.
open-iscsi/rtslib-fb@20a50d9

@dillaman
Copy link

@swimfish09 my point is that just because you can technically do something, it doesn’t mean that it should be considered best or standard practice.

@swimfish09
Copy link
Author

@dillaman fine, is there any technical document that i can view?

@mikechristie
Copy link
Contributor

@swimfish09 There is no spec type of document.

@swimfish09
Copy link
Author

swimfish09 commented Jan 21, 2019

record from start to create a disk.
python -m cProfile -o profile.out rbd-target-api.py
result:
image

@swimfish09
Copy link
Author

swimfish09 commented Jan 22, 2019

function map_luns contains four loops, which cost a lot of time
when create a disk two gateways will cost double times

image
image

@swimfish09
Copy link
Author

swimfish09 commented Jan 22, 2019

i created a patch here.
ceph/ceph-iscsi-config#100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants