]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/doc/blobfs/getting_started.md
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / spdk / doc / blobfs / getting_started.md
1 # BlobFS Getting Started Guide {#blobfs_getting_started}
2
3 # RocksDB Integration {#blobfs_rocksdb}
4
5 1. Build SPDK as normal.
6
7 2. Clone the RocksDB git repo from the SPDK github projects. Make sure you check out the spdk branch.
8
9 git clone -b spdk https://github.com/spdk/rocksdb.git
10
11 3. Build RocksDB. Note that currently only the db_bench benchmarking tool is integrated with BlobFS.
12 (Note: add "DEBUG_LEVEL=0" for a release build.)
13
14 make db_bench DPDK_DIR=path/to/dpdk/x86_64-native-linuxapp-gcc SPDK_DIR=path/to/spdk
15
16 4. Copy etc/spdk/rocksdb.conf.in to /usr/local/etc/spdk/rocksdb.conf.
17
18 5. Append an NVMe section to the configuration file.
19
20 scripts/gen_nvme.sh >> /usr/local/etc/spdk/rocksdb.conf
21
22 6. Verify the configuration file has specified the correct NVMe SSD. If there are any NVMe SSDs you do not wish to use for RocksDB/SPDK testing, remove them from the configuration file.
23 7. Make sure you have at least 5GB of memory allocated for huge pages. By default the SPDK setup.sh script only allocates 2GB (1024 huge pages). The following will allocate 5GB worth of 2MB huge pages (in addition to binding the NVMe devices to uio/vfio). If using 1GB huge pages, adjust the NRHUGE value accordingly.
24
25 NRHUGE=2560 scripts/setup.sh
26
27 8. Create an empty SPDK blobfs for testing.
28
29 test/lib/blobfs/mkfs/mkfs /usr/local/etc/spdk/rocksdb.conf Nvme0n1
30
31 At this point, RocksDB is ready for testing with SPDK. Three db_bench parameters are used to configure SPDK:
32
33 1. spdk - Defines the name of the SPDK configuration file. If omitted, RocksDB will use the default PosixEnv implementation
34 instead of SpdkEnv. (Required)
35 2. spdk_bdev - Defines the name of the SPDK block device which contains the BlobFS to be used for testing. (Required)
36 3. spdk_cache_size - Defines the amount of userspace cache memory used by SPDK. Specified in terms of megabytes (MB).
37 Default is 4096 (4GB). (Optional)
38
39 SPDK has a set of scripts which will run db_bench against a variety of workloads and capture performance and profiling
40 data. The primary script is `test/blobfs/rocksdb/run_tests.sh`.
41
42 # FUSE
43
44 BlobFS provides a FUSE plug-in to mount an SPDK BlobFS as a kernel filesystem for inspection or debug purposes.
45 The FUSE plug-in requires fuse3 and will be built automatically when fuse3 is detected on the system.
46
47 test/lib/blobfs/fuse/fuse /usr/local/etc/spdk/rocksdb.conf Nvme0n1 /mnt/fuse
48
49 Note that the FUSE plug-in has some limitations - see the list below.
50
51 # Limitations
52
53 * BlobFS has primarily been tested with RocksDB so far, so any use cases different from how RocksDB uses a filesystem
54 may run into issues. BlobFS will be tested in a broader range of use cases after this initial release.
55 * Only a synchronous API is currently supported. An asynchronous API has been developed but not thoroughly tested
56 yet so is not part of the public interface yet. This will be added in a future release.
57 * File renames are not atomic. This will be fixed in a future release.
58 * BlobFS currently supports only a flat namespace for files with no directory support. Filenames are currently stored
59 as xattrs in each blob. This means that filename lookup is an O(n) operation. An SPDK btree implementation is
60 underway which will be the underpinning for BlobFS directory support in a future release.
61 * Writes to a file must always append to the end of the file. Support for writes to any location within the file
62 will be added in a future release.