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

common: bench test get incorrect iops result #16381

Closed
wants to merge 1 commit into from

Conversation

PCzhangPC
Copy link

@PCzhangPC PCzhangPC commented Jul 18, 2017

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

Copy link
Member

@joscollin joscollin left a 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/

@PCzhangPC PCzhangPC changed the title fix some bench problems rados: bench test iops incorrct Jul 18, 2017
@PCzhangPC PCzhangPC changed the title rados: bench test iops incorrct rados: bench test iops result incorrct Jul 18, 2017
@PCzhangPC
Copy link
Author

PCzhangPC commented Jul 18, 2017

@joscollin i have added the Signed-off-by.but, can you tell me how to retest this? thx...

@joscollin
Copy link
Member

Jenkins retest this please

@joscollin
Copy link
Member

@PCzhangPC Please correct the commit title and the body appropriately.

Please see this as an example: https://github.com/ceph/ceph/pull/15648/commits.
If you don't have an external reference (Fixes:), then give a brief description by yourself in the body.

@PCzhangPC
Copy link
Author

@joscollin @yangdongsheng please help to review this pr ,thx

@PCzhangPC PCzhangPC changed the title rados: bench test iops result incorrct rados: bench test get incorrct iops result Aug 7, 2017
@joscollin joscollin changed the title rados: bench test get incorrct iops result common: bench test get incorrect iops result Aug 7, 2017
@joscollin joscollin added the core label Aug 7, 2017
Copy link
Member

@joscollin joscollin left a 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.

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) {
Copy link
Member

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 ?

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@PCzhangPC
Copy link
Author

PCzhangPC commented Aug 8, 2017

There is something wrong in my last commit, and i remove the (1<runtime<2) part.
The max_iops is initialized as 0 and min_iops is initialized as MAX_INT. If the command finishes less than 1s, the function 'void *ObjBencher::status_printer' will not update the value of max/min_iops because the variable 'cyclesinceChange' is set to 0 and will not change within a second. so the result will be 0 and MAX_INT.
as for (1<runtime<2) part, for example,if the runtime is 1.2s, the max_iops and min_iops is calculated in the first second.but in the last 0.2 second, htere are orther writes/reads to finish but we dont't update the max/min_iops again. so the average_iops is lagger than max_iops. in last commit, i added an condition to handle this situation, which was not appropriate. i remove this part, so this pr just to solve the problem when runtime<1.
@joscollin @yangdongsheng

@yangdongsheng
Copy link
Contributor

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?

@@ -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) {
Copy link
Member

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 ?

Copy link
Author

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.

Copy link
Member

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?

Copy link
Author

@PCzhangPC PCzhangPC Aug 15, 2017

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

Copy link
Member

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 :-)

Copy link
Author

@PCzhangPC PCzhangPC Aug 16, 2017

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>
@joscollin
Copy link
Member

@liewegas @jdurgin
Could you please merge ? Thanks.

@PCzhangPC
Copy link
Author

@ceph-jenkins Jenkins retest this please

@tchaikov
Copy link
Contributor

@PCzhangPC i fixed this issue in a slightly simpler way at #17182, could you take a look?

@PCzhangPC PCzhangPC closed this Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants