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

os/bluestore: improve required compression threshold #10080

Merged
merged 1 commit into from Jul 2, 2016

Conversation

xiexingguo
Copy link
Member

…ssion

Require the net gain of compression at least to be at a specified ratio,
otherwise we don't compress.

Ask for compressing at least 12.5% off, by default.

This is for the sake of performance because if the compression turns out
to be meaningless(saving little space), we can simply shut it down, as we
know the compression/decompression can be rather CPU-consuming.

Signed-off-by: xie xingguo xie.xingguo@zte.com.cn

uint64_t dstlen = final_length *
g_conf->bluestore_compression_required_ratio;
dstlen = ROUND_UP_TO(dstlen, min_alloc_size);
if (newlen < dstlen) {
Copy link
Member

Choose a reason for hiding this comment

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

i would do <=, as .125 is 1/8 and it is likely we'll actually hit that pretty frequently. maybe also keep newlen < final_length in there too, as the configured min after rounding up might == final_length?

@liewegas
Copy link
Member

liewegas commented Jul 1, 2016

At some point we probably also want a heuristic that makes us stop trying to compress writes to an object if they never compress down..

…ssion

Require the net gain of compression at least to be at a specified ratio,
otherwise we don't compress.

Ask for compressing at least 12.5% off, by default.

This is for the sake of performance because if the compression turns out
to be meaningless(saving little space), we can simply shut it down, as we
know the compression/decompression can be rather CPU-consuming.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo
Copy link
Member Author

@liewegas Done.

At some point we probably also want a heuristic that makes us stop trying to compress writes to an object if they never compress down..

Well, I'll try...

@liewegas
Copy link
Member

liewegas commented Jul 2, 2016 via email

@xiexingguo
Copy link
Member Author

Okay, do you still want this change?

@liewegas liewegas changed the title os/bluestore: add compression required ratio to enable/disable compre… os/bluestore: improve required compression threshold Jul 2, 2016
@liewegas liewegas merged commit 7cff281 into ceph:master Jul 2, 2016
@xiexingguo xiexingguo deleted the xxg-wip-add-compress-ratio branch July 2, 2016 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants