File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,26 @@ cd s3-cas
18
18
cargo build --release --features binary
19
19
```
20
20
21
+ ## Inline metadata
22
+
23
+ Objects smaller than or equal to a configurable threshold can be stored directly in their metadata records,
24
+ improving performance for small objects.
25
+
26
+ Configure this feature using the command-line option:
27
+ ``` console
28
+ --inline-metadata-size <size> # omit to disable inlining
29
+ ```
30
+
31
+ When the size is set:
32
+ - If the size of object data + metadata smaller than or equal to the threshold, the object data is stored in the metadata,
33
+ otherwise use the standard block storage
34
+ - Setting size to 0 or omitting the option disables inlining completely
35
+
36
+ Currently, objects uploaded using the multipart method will never be inlined
37
+ because they are assumed to be large objects.
38
+
21
39
## Known issues
22
40
23
- - The metadata database (sled) has unbounded memory growth related to the objects stored. This means
24
- the server will eventually consume all memory on the host and crash. To fix this the metadata database
25
- should either be replaced with a new version of sled (still in development) or a different one entirely
26
41
- Only the basic API is implemented, and even then it is not entirely implemented (for instance copy
27
42
between servers is not implemented).
28
- - The codebase is very much POC and not following a good abstraction structure
29
43
- Single key only, no support to add multiple keys with different permissions.
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ struct Args {
31
31
#[ structopt( long, default_value = "9100" ) ]
32
32
metric_port : u16 ,
33
33
34
+ #[ structopt( long, help = "leave empty to disable it" ) ]
35
+ inline_metadata_size : Option < usize > ,
36
+
34
37
#[ structopt( long, requires( "secret-key" ) , display_order = 1000 ) ]
35
38
access_key : Option < String > ,
36
39
@@ -71,7 +74,7 @@ async fn run(args: Args) -> anyhow::Result<()> {
71
74
args. meta_root . clone ( ) ,
72
75
metrics. clone ( ) ,
73
76
storage_engine,
74
- None ,
77
+ args . inline_metadata_size ,
75
78
) ;
76
79
let s3fs = s3_cas:: s3fs:: S3FS :: new ( args. fs_root , args. meta_root , casfs, metrics. clone ( ) ) ;
77
80
let s3fs = s3_cas:: metrics:: MetricFs :: new ( s3fs, metrics. clone ( ) ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ impl std::fmt::Debug for FjallStore {
26
26
}
27
27
}
28
28
29
- const DEFAULT_INLINED_METADATA_SIZE : usize = 1024 ;
29
+ const DEFAULT_INLINED_METADATA_SIZE : usize = 1 ; // setting very low will practically disable it by default
30
30
31
31
impl FjallStore {
32
32
pub fn new ( path : PathBuf , inlined_metadata_size : Option < usize > ) -> Self {
You can’t perform that action at this time.
0 commit comments