commitlog, sstables: enlarge XFS extent allocation for large files

With big rows I see contention in XFS allocations which cause reactor
thread to sleep. Commitlog is a main offender, so enlarge extent to
commitlog segment size for big files (commitlog and sstable Data files).

Message-Id: <20160404110952.GP20957@scylladb.com>
This commit is contained in:
Gleb Natapov
2016-04-04 14:09:52 +03:00
committed by Avi Kivity
parent 725231a7a0
commit 70575699e4
Notes: Pekka Enberg 2016-04-07 10:04:56 +03:00
backport: 1.0
2 changed files with 13 additions and 2 deletions

View File

@@ -1060,7 +1060,9 @@ void db::commitlog::segment_manager::flush_segments(bool force) {
future<db::commitlog::segment_manager::sseg_ptr> db::commitlog::segment_manager::allocate_segment(bool active) {
descriptor d(next_id());
return open_checked_file_dma(commit_error, cfg.commit_log_location + "/" + d.filename(), open_flags::wo | open_flags::create).then([this, d, active](file f) {
file_open_options opt;
opt.extent_allocation_size_hint = max_size;
return open_checked_file_dma(commit_error, cfg.commit_log_location + "/" + d.filename(), open_flags::wo | open_flags::create, opt).then([this, d, active](file f) {
// xfs doesn't like files extended betond eof, so enlarge the file
return f.truncate(max_size).then([this, d, active, f] () mutable {
auto s = make_lw_shared<segment>(this->shared_from_this(), d, std::move(f), active);