Project

General

Profile

Actions

Bug #38559

closed
VF

50-100% iops lost due to bluefs_preextend_wal_files = false

Bug #38559: 50-100% iops lost due to bluefs_preextend_wal_files = false

Added by Vitaliy Filippov almost 8 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
mimic, nautilus, luminous
Regression:
No
Severity:
1 - critical
Reviewed:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v15.0.0-1776-g194b915e88
Released In:
v15.2.0~3176
Upkeep Timestamp:
2025-07-20T05:13:26+00:00

Description

Hi.

I was investigating why RocksDB performance is so bad considering random 4K iops. I was looking at strace and one thing catched my eye - that was the OSD doing TWO transactions for each small (deferred) incoming write. In both mimic and nautilus strace looks like the following:

There are groups of 5 operations repeated by `bstore_kv_sync`:

  • pwritev(8-12 kb, offset=1440402997248), offsets always increase
  • sync_file_range(just written 8-12 kb)
  • fdatasync()
  • io_submit(op=pwritev, iov_len=4 kb, aio_offset=1455403167744) - offsets differ from first step, but also increase by 4 kb with each write
  • fdatasync()

After every 64 such groups there come some io_submit's from `bstore_kv_final` - this is obviously the application of deferred writes, and the first pwritev is obviously the RocksDB WAL.

But what's the remaining io_submit?

It is the BlueFS's WAL! And all that it seems to do is to increase the size of RocksDB WAL and changing its modification time. So again you have "journaling of the journal"-like issue, as in old days with filestore :)

Then I found the "bluefs_preextend_wal_files" option, and yes, it disables this behaviour when set to true, and random IOPS increase by +50..+100% depending on the workload. But it corrupts the RocksDB when the OSD is shut down uncleanly. It's https://tracker.ceph.com/issues/18338 which I easily reproduced by starting a single OSD locally and writing with "fio -ioengine=rbd -direct=1 -invalidate=1 -name=test -bs=4M -iodepth=16 -rw=write -pool=bench -rbdname=testimg" into it.

I think this is REALLY ugly. Bluestore is just wasting 1/3 to 1/2 random iops performance. It must be fixed :)


Related issues 3 (0 open — 3 closed)

Copied to bluestore - Backport #40280: mimic: 50-100% iops lost due to bluefs_preextend_wal_files = falseResolvedNathan Cutler

Actions
Copied to bluestore - Backport #40281: nautilus: 50-100% iops lost due to bluefs_preextend_wal_files = falseResolvedNathan Cutler

Actions
Copied to bluestore - Backport #41510: luminous: 50-100% iops lost due to bluefs_preextend_wal_files = falseResolved

Actions

GF Updated by Greg Farnum over 7 years ago Actions #1

  • Project changed from Ceph to bluestore

SW Updated by Sage Weil over 7 years ago Actions #2

This goes away after you write more metadta into rocksdb and it starts overwriting previous wal files. The purpose of this option is only to make things fast out of the gate for the purposes of convenient benchmarking etc.

SW Updated by Sage Weil over 7 years ago Actions #3

  • Status changed from New to 12

VF Updated by Vitaliy Filippov over 7 years ago Actions #4

Yes, I've thought of that but I haven't tested it... However this is rather strange then. Who does the fsync if BlueFS isn't writing to WALs? sync_file_range is called with unsafe flags so it's something else...

In fact I've submitted a pull request here https://github.com/ceph/ceph/pull/26870

It adds more wait flags to sync_file_range, makes it safe and thus makes it possible to enable bluefs_preextend_wal_files. I experience +100% iops on HDD setups with this patch and bluefs_preextend_wal_files set to true.

KC Updated by Kefu Chai over 7 years ago Actions #6

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to mimic, nautilus
  • Pull request ID set to 26909

NC Updated by Nathan Cutler over 7 years ago Actions #7

  • Copied to Backport #40280: mimic: 50-100% iops lost due to bluefs_preextend_wal_files = false added

NC Updated by Nathan Cutler over 7 years ago Actions #8

  • Copied to Backport #40281: nautilus: 50-100% iops lost due to bluefs_preextend_wal_files = false added

NC Updated by Nathan Cutler over 7 years ago Actions #10

  • Status changed from Pending Backport to Resolved

Having been run with --resolve-parent, the script "backport-create-issue" set the status of this issue to "Resolved" because it determined all backport issues are in status Resolved.

NC Updated by Nathan Cutler over 7 years ago Actions #11

  • Backport changed from mimic, nautilus to mimic, nautilus, luminous

NC Updated by Nathan Cutler over 7 years ago Actions #12

  • Status changed from Resolved to Pending Backport
  • Target version deleted (v14.0.0)

NC Updated by Nathan Cutler over 7 years ago Actions #13

  • Copied to Backport #41510: luminous: 50-100% iops lost due to bluefs_preextend_wal_files = false added

NC Updated by Nathan Cutler about 7 years ago Actions #14

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

UB Updated by Upkeep Bot over 1 year ago Actions #15

  • Merge Commit set to 194b915e88692d0151195b4205e2a5d59e563971
  • Fixed In set to v15.0.0-1776-g194b915e88
  • Released In set to v15.2.0~3176
  • Upkeep Timestamp set to 2025-07-20T05:13:26+00:00
Actions

Also available in: PDF Atom