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
common: bench test get incorrect iops result #16381
Conversation
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.
In Ceph we conventionally put the Signed-off-by
at the end of a commit message. The title of the Commit should be prefixed with the submodule name followed by a short description of the fix. A detailed description should be added as the body of the Commit message. Please see one of my merged PR as an example: https://github.com/ceph/ceph/pull/15648/commits
See this too: https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#1-sign-your-work
You can do:
$git commit --amend.
Modify your commit and add the `Signed-off-by` manually for this time.
Then push using -f option again: $git push origin test -f
From the next time onwards remember to use -s
when you commit your changes, so that the Signed-off-by will be added automatically to your commit, if you configure your git settings properly.
Please see: https://help.github.com/articles/setting-your-username-in-git/
https://help.github.com/articles/setting-your-email-in-git/
@joscollin i have added the Signed-off-by.but, can you tell me how to retest this? thx... |
Jenkins retest this please |
@PCzhangPC Please correct the commit title and the body appropriately. Please see this as an example: https://github.com/ceph/ceph/pull/15648/commits. |
8c0e30e
to
7d9e95d
Compare
c4d5f54
to
ed348fe
Compare
@joscollin @yangdongsheng please help to review this pr ,thx |
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.
if the running time of this command is too short
I was wondering how did you came up with runtime values <=2
for too short
situation.
src/common/obj_bencher.cc
Outdated
if(data.idata.max_iops == 0 && data.idata.min_iops == INT_MAX) | ||
data.idata.max_iops = data.idata.min_iops = (int)(data.finished/runtime); | ||
} | ||
if(runtime > 1 && runtime <= 2) { |
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.
This always evaluates to runtime == 2
right ?
src/common/obj_bencher.cc
Outdated
if(data.idata.max_iops == 0 && data.idata.min_iops == INT_MAX) | ||
data.idata.max_iops = data.idata.min_iops = (int)(data.finished/runtime); | ||
} | ||
if(runtime > 1 && runtime <= 2) { |
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.
ditto
ac6c37f
to
1ef506e
Compare
There is something wrong in my last commit, and i remove the (1<runtime<2) part. |
okey @PCzhangPC So the problem is MIN_IOPS and MAX_IOPS will not be updated when the runtime <= 1, right? okey sounds fair enough now. @joscollin what do you think about it? |
src/common/obj_bencher.cc
Outdated
@@ -799,6 +799,11 @@ int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurre | |||
} | |||
|
|||
runtime = ceph_clock_now() - data.start_time; | |||
if(runtime <= 1) { |
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.
so this pr just to solve the problem when runtime<1.
Are you considering runtime == 1
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.
oh sorry. there will be no need to update the iops again if runtime==1 because it has get correct result already. and commit has been updated.
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.
if the running time of this command is less than 1s
@PCzhangPC I was wondering whether this 1s
will change to 2s
in another execution in another machine with a different performance. Have you tried anything like that? Is this 1s
depends on your execution environment?
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.
@joscollin it's the same in different machine. as you can see the logic in here1 , the IOPS will only be calculated when the cycleSinceChange is not 0. and the cycleSinceChange will increase once a second. but if the runtime is less than 1s, this variable has no chance to change from 0 to 1. and so, the max/min_iops will show as 0/MAX_INT.
[1]https://github.com/ceph/ceph/blob/master/src/common/obj_bencher.cc#L127
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.
Aah, sorry. My bad, I didn't check that part :-)
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.
thx for your review :-)
Fixes: bench write/read test command may get wrong result when the test time is less than 1s. Signed-off-by: PCzhangPC <pengcheng.zhang@easystack.cn>
@ceph-jenkins Jenkins retest this please |
@PCzhangPC i fixed this issue in a slightly simpler way at #17182, could you take a look? |
when running : rados -p test bench 20 seq(rand), if the running time of this command is less than 1s,the max/min_iops will not be updated after initialized to 0 and MAX_INT, so the result would be incorrect as below:
Average IOPS: 180
Stddev IOPS: 0
Max IOPS: 0
Min IOPS: 2147483647
Signed-off-by: PCzhangPC pengcheng.zhang@easystack.cn