1 =======================
3 =======================
5 See `Block Device`_ for additional details.
10 ``rbd compression hint``
12 :Description: Hint to send to the OSDs on write operations. If set to `compressible` and the OSD `bluestore compression mode` setting is `passive`, the OSD will attempt to compress the data. If set to `incompressible` and the OSD compression setting is `aggressive`, the OSD will not attempt to compress the data.
16 :Values: ``none``, ``compressible``, ``incompressible``
18 ``rbd read from replica policy``
20 :Description: policy for determining which OSD will receive read operations. If set to `default`, the primary OSD will always be used for read operations. If set to `balance`, read operations will be sent to a randomly selected OSD within the replica set. If set to `localize`, read operations will be sent to the closest OSD as determined by the CRUSH map. Note: this feature requires the cluster to be configured with a minimum compatible OSD release of Octopus.
24 :Values: ``default``, ``balance``, ``localize``
27 =======================
29 .. sidebar:: Kernel Caching
31 The kernel driver for Ceph block devices can use the Linux page cache to
34 The user space implementation of the Ceph block device (i.e., ``librbd``) cannot
35 take advantage of the Linux page cache, so it includes its own in-memory
36 caching, called "RBD caching." RBD caching behaves just like well-behaved hard
37 disk caching. When the OS sends a barrier or a flush request, all dirty data is
38 written to the OSDs. This means that using write-back caching is just as safe as
39 using a well-behaved physical hard disk with a VM that properly sends flushes
40 (i.e. Linux kernel >= 2.6.32). The cache uses a Least Recently Used (LRU)
41 algorithm, and in write-back mode it can coalesce contiguous requests for
44 The librbd cache is enabled by default and supports three different cache
45 policies: write-around, write-back, and write-through. Writes return
46 immediately under both the write-around and write-back policies, unless there
47 are more than ``rbd cache max dirty`` unwritten bytes to the storage cluster.
48 The write-around policy differs from the write-back policy in that it does
49 not attempt to service read requests from the cache, unlike the write-back
50 policy, and is therefore faster for high performance write workloads. Under the
51 write-through policy, writes return only when the data is on disk on all
52 replicas, but reads may come from the cache.
54 Prior to receiving a flush request, the cache behaves like a write-through cache
55 to ensure safe operation for older operating systems that do not send flushes to
56 ensure crash consistent behavior.
58 If the librbd cache is disabled, writes and
59 reads go directly to the storage cluster, and writes return only when the data
60 is on disk on all replicas.
63 The cache is in memory on the client, and each RBD image has
64 its own. Since the cache is local to the client, there's no coherency
65 if there are others accessing the image. Running GFS or OCFS on top of
66 RBD will not work with caching enabled.
69 The ``ceph.conf`` file settings for RBD should be set in the ``[client]``
70 section of your configuration file. The settings include:
75 :Description: Enable caching for RADOS Block Device (RBD).
83 :Description: Select the caching policy for librbd.
86 :Default: ``writearound``
87 :Values: ``writearound``, ``writeback``, ``writethrough``
90 ``rbd cache writethrough until flush``
92 :Description: Start out in write-through mode, and switch to write-back after the first flush request is received. Enabling this is a conservative but safe setting in case VMs running on rbd are too old to send flushes, like the virtio driver in Linux before 2.6.32.
100 :Description: The RBD cache size in bytes.
101 :Type: 64-bit Integer
104 :Policies: write-back and write-through
107 ``rbd cache max dirty``
109 :Description: The ``dirty`` limit in bytes at which the cache triggers write-back. If ``0``, uses write-through caching.
110 :Type: 64-bit Integer
112 :Constraint: Must be less than ``rbd cache size``.
114 :Policies: write-around and write-back
117 ``rbd cache target dirty``
119 :Description: The ``dirty target`` before the cache begins writing data to the data storage. Does not block writes to the cache.
120 :Type: 64-bit Integer
122 :Constraint: Must be less than ``rbd cache max dirty``.
124 :Policies: write-back
127 ``rbd cache max dirty age``
129 :Description: The number of seconds dirty data is in the cache before writeback starts.
133 :Policies: write-back
136 .. _Block Device: ../../rbd
140 =======================
142 librbd supports read-ahead/prefetching to optimize small, sequential reads.
143 This should normally be handled by the guest OS in the case of a VM,
144 but boot loaders may not issue efficient reads. Read-ahead is automatically
145 disabled if caching is disabled or if the policy is write-around.
148 ``rbd readahead trigger requests``
150 :Description: Number of sequential read requests necessary to trigger read-ahead.
156 ``rbd readahead max bytes``
158 :Description: Maximum size of a read-ahead request. If zero, read-ahead is disabled.
159 :Type: 64-bit Integer
161 :Default: ``512 KiB``
164 ``rbd readahead disable after bytes``
166 :Description: After this many bytes have been read from an RBD image, read-ahead is disabled for that image until it is closed. This allows the guest OS to take over read-ahead once it is booted. If zero, read-ahead stays enabled.
167 :Type: 64-bit Integer
175 RBD supports advanced features which can be specified via the command line when creating images or the default features can be specified via Ceph config file via 'rbd_default_features = <sum of feature numeric values>' or 'rbd_default_features = <comma-delimited list of CLI values>'
179 :Description: Layering enables you to use cloning.
182 :Added in: v0.52 (Bobtail)
183 :KRBD support: since v3.10
188 :Description: Striping spreads data across multiple objects. Striping helps with parallelism for sequential read/write workloads.
191 :Added in: v0.55 (Bobtail)
192 :KRBD support: since v3.10 (default striping only, "fancy" striping added in v4.17)
195 ``Exclusive locking``
197 :Description: When enabled, it requires a client to get a lock on an object before making a write. Exclusive lock should only be enabled when a single client is accessing an image at the same time.
199 :CLI value: exclusive-lock
200 :Added in: v0.92 (Hammer)
201 :KRBD support: since v4.9
206 :Description: Object map support depends on exclusive lock support. Block devices are thin provisioned—meaning, they only store data that actually exists. Object map support helps track which objects actually exist (have data stored on a drive). Enabling object map support speeds up I/O operations for cloning; importing and exporting a sparsely populated image; and deleting.
208 :CLI value: object-map
209 :Added in: v0.93 (Hammer)
210 :KRBD support: since v5.3
216 :Description: Fast-diff support depends on object map support and exclusive lock support. It adds another property to the object map, which makes it much faster to generate diffs between snapshots of an image, and the actual data usage of a snapshot much faster.
218 :CLI value: fast-diff
219 :Added in: v9.0.1 (Infernalis)
220 :KRBD support: since v5.3
226 :Description: Deep-flatten makes rbd flatten work on all the snapshots of an image, in addition to the image itself. Without it, snapshots of an image will still rely on the parent, so the parent will not be delete-able until the snapshots are deleted. Deep-flatten makes a parent independent of its clones, even if they have snapshots.
228 :CLI value: deep-flatten
229 :Added in: v9.0.2 (Infernalis)
230 :KRBD support: since v5.1
236 :Description: Journaling support depends on exclusive lock support. Journaling records all modifications to an image in the order they occur. RBD mirroring utilizes the journal to replicate a crash consistent image to a remote cluster.
238 :CLI value: journaling
239 :Added in: v10.0.1 (Jewel)
246 :Description: On erasure-coded pools, the image data block objects need to be stored on a separate pool from the image metadata.
248 :Added in: v11.1.0 (Kraken)
249 :KRBD support: since v4.11
255 :Description: Used to restrict older clients from performing certain maintenance operations against an image (e.g. clone, snap create).
257 :Added in: v13.0.2 (Mimic)
258 :KRBD support: since v4.16
263 :Description: Used to restrict older clients from opening an image when it is in migration state.
265 :Added in: v14.0.1 (Nautilus)
270 :Description: Used to restrict changes to non-primary images using snapshot-based mirroring.
271 :Internal value: 1024
272 :Added in: v15.2.0 (Octopus)
279 librbd supports limiting per image IO, controlled by the following
282 ``rbd qos iops limit``
284 :Description: The desired limit of IO operations per second.
285 :Type: Unsigned Integer
290 ``rbd qos bps limit``
292 :Description: The desired limit of IO bytes per second.
293 :Type: Unsigned Integer
298 ``rbd qos read iops limit``
300 :Description: The desired limit of read operations per second.
301 :Type: Unsigned Integer
306 ``rbd qos write iops limit``
308 :Description: The desired limit of write operations per second.
309 :Type: Unsigned Integer
314 ``rbd qos read bps limit``
316 :Description: The desired limit of read bytes per second.
317 :Type: Unsigned Integer
322 ``rbd qos write bps limit``
324 :Description: The desired limit of write bytes per second.
325 :Type: Unsigned Integer
330 ``rbd qos iops burst``
332 :Description: The desired burst limit of IO operations.
333 :Type: Unsigned Integer
338 ``rbd qos bps burst``
340 :Description: The desired burst limit of IO bytes.
341 :Type: Unsigned Integer
346 ``rbd qos read iops burst``
348 :Description: The desired burst limit of read operations.
349 :Type: Unsigned Integer
354 ``rbd qos write iops burst``
356 :Description: The desired burst limit of write operations.
357 :Type: Unsigned Integer
362 ``rbd qos read bps burst``
364 :Description: The desired burst limit of read bytes.
365 :Type: Unsigned Integer
370 ``rbd qos write bps burst``
372 :Description: The desired burst limit of write bytes.
373 :Type: Unsigned Integer
378 ``rbd qos schedule tick min``
380 :Description: The minimum schedule tick (in milliseconds) for QoS.
381 :Type: Unsigned Integer