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

try to optimize getting all controllers #1659

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

jreidinger
Copy link
Contributor

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

real	0m10.851s
user	0m0.005s
sys	0m0.005s

@coveralls
Copy link

coveralls commented Oct 8, 2024

Pull Request Test Coverage Report for Build 11243278108

Details

  • 0 of 30 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.07%) to 70.523%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rust/agama-lib/src/storage/client/zfcp.rs 0 30 0.0%
Files with Coverage Reduction New Missed Lines %
rust/agama-lib/src/storage/client/zfcp.rs 1 0.0%
Totals Coverage Status
Change from base Build 11209402098: -0.07%
Covered Lines: 15836
Relevant Lines: 22455

💛 - Coveralls

for wwpn in wwpns {
tasks.push((
wwpn.clone(),
tokio::spawn(get_luns(controller_id.to_string(), wwpn.clone())),
Copy link
Contributor

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.

Copy link
Contributor

@imobachgs imobachgs Oct 8, 2024

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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()))
Copy link
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

3 participants