-
Notifications
You must be signed in to change notification settings - Fork 21
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
rescan-scsi-bus.sh: function "findremapped" is too slow when there is 1K luns on server,is there any way to solve it? #22
Comments
Been thinking about this one but have not found any way to make it substantially faster. I read that in environments using Unicode that adding 'export LC_ALL="C" ' at the top of the script can speed calls to standard Unix string searching utilities (e.g. grep). My locale is en_CA.UTF-8 (i.e. not Unicode) and that export made a small improvement. I'm open to ideas from others. Also could you quantify "too slow"? |
we found there is a O(n^2) in this func which comes from "while" and "findmultipath", and we use this shell like "scsi-rescan -f -u -m", so if a lun has m paths, loop times equals to m * 1K * 1K。
“Also could you quantify "too slow"?”:I will e-mail you a result of contrast later on |
Looks good. I think you need something like 'truncate -s 0 $TMPLUNINFOFILE' at the start of getallmultipathinfo() since rescan-scsi-bus.sh may be called more than once. Look forward to your timings report showing a significant improvement. |
We tested with “rescan-scsi-bus -f -u -m” on the original and optimized script. All SCSI devices have been mapped to dm device. Here is the comparison of time spent before and after optimization:
We found the most time exhausted on these two code lines in original script:
They spent almost 5 seconds when there are 128LUNs * 16paths, and 10~15 seconds when 256LUNs * 16paths each execute. And the outer loop should loop 2k or 4k times. |
Speed multipath scans with many LUNs by caching multipath LUN info in temporary file, see: #22 Fix small bug in last commit, see: #24 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@973 6180dd3e-e324-4e3e-922d-17de1ae2f315
I have placed this patch in svn revision 973 now mirrored. Perhaps you could check if that as been done accurately and that the impressive speed-up is still present. |
Speed multipath scans with many LUNs by caching multipath LUN info in temporary file, see: doug-gilbert/sg3_utils#22 Fix small bug in last commit, see: doug-gilbert/sg3_utils#24 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@973 6180dd3e-e324-4e3e-922d-17de1ae2f315
Speed multipath scans with many LUNs by caching multipath LUN info in temporary file, see: doug-gilbert/sg3_utils#22 Fix small bug in last commit, see: doug-gilbert/sg3_utils#24 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@973 6180dd3e-e324-4e3e-922d-17de1ae2f315
There is a loop nesting in function "findremapped".
we use "scsi-rescan -f -u -m" to scan all devices.
The text was updated successfully, but these errors were encountered: