-
Notifications
You must be signed in to change notification settings - Fork 44
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
try to optimize getting all controllers #1659
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 11243278108Details
💛 - Coveralls |
for wwpn in wwpns { | ||
tasks.push(( | ||
wwpn.clone(), | ||
tokio::spawn(get_luns(controller_id.to_string(), wwpn.clone())), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of spawning all those processes, I would suggest giving join_all a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tokio has JoinSet, which might be interesting too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for suggestion. I plan to have it as experiment first and this tokio spawn is suggested way in that linkedin rust training, so it is the first that I would like to give a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and testing shows that my change somehow does not work, but as it is just learning/research project I will put it a bit on hold and focus on planned stuff and return to it probably next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I cannot sleep without debugging it...so now it is fixed and time is improved to 6.3 second..so already it goes down from 10.8 to 6.3 and I think it can be even better if I parallel also getting wwpns for controller. And then I can start playing with join_all and JoinSet
let mut tasks = vec![]; | ||
for (_path, partial_controller) in &devices { | ||
tasks.push( | ||
tokio::spawn(get_luns_map(partial_controller.channel.clone())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this additional paralellization time is reduced to 5.3 seconds. So basically for two controllers with 3 LUNS in total it is gets to half of time. I expect that for bigger systems it will be even more significant.
Problem
Getting zfcp controllers is very slow call.
Solution
Try thread approach without dbus calls for this specific http call.
Testing
original time on our testing s390