Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
5d76db8f
Commit
5d76db8f
authored
11 months ago
by
Jason Volk
Committed by
🥺
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
add configuration for rocksdb direct-io enablement
Signed-off-by:
Jason Volk
<
jason@zemos.net
>
parent
f4a2b39d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conduwuit-example.toml
+4
-0
4 additions, 0 deletions
conduwuit-example.toml
src/config/mod.rs
+4
-0
4 additions, 0 deletions
src/config/mod.rs
src/database/rocksdb/opts.rs
+4
-2
4 additions, 2 deletions
src/database/rocksdb/opts.rs
with
12 additions
and
2 deletions
conduwuit-example.toml
+
4
−
0
View file @
5d76db8f
...
@@ -384,6 +384,10 @@ allow_profile_lookup_federation_requests = true
...
@@ -384,6 +384,10 @@ allow_profile_lookup_federation_requests = true
# Defaults to false
# Defaults to false
#rocksdb_optimize_for_spinning_disks = false
#rocksdb_optimize_for_spinning_disks = false
# Enables direct-io to increase database performance. This is enabled by default. Set this option to false if the
# database resides on a filesystem which does not support direct-io.
#rocksdb_direct_io = true
# RocksDB log level. This is not the same as conduwuit's log level. This is the log level for the RocksDB engine/library
# RocksDB log level. This is not the same as conduwuit's log level. This is the log level for the RocksDB engine/library
# which show up in your database folder/path as `LOG` files. Defaults to error. conduwuit will typically log RocksDB errors as normal.
# which show up in your database folder/path as `LOG` files. Defaults to error. conduwuit will typically log RocksDB errors as normal.
#rocksdb_log_level = "error"
#rocksdb_log_level = "error"
...
...
This diff is collapsed.
Click to expand it.
src/config/mod.rs
+
4
−
0
View file @
5d76db8f
...
@@ -218,6 +218,8 @@ pub(crate) struct Config {
...
@@ -218,6 +218,8 @@ pub(crate) struct Config {
pub
(
crate
)
rocksdb_log_time_to_roll
:
usize
,
pub
(
crate
)
rocksdb_log_time_to_roll
:
usize
,
#[serde(default)]
#[serde(default)]
pub
(
crate
)
rocksdb_optimize_for_spinning_disks
:
bool
,
pub
(
crate
)
rocksdb_optimize_for_spinning_disks
:
bool
,
#[serde(default
=
"true_fn"
)]
pub
(
crate
)
rocksdb_direct_io
:
bool
,
#[serde(default
=
"default_rocksdb_parallelism_threads"
)]
#[serde(default
=
"default_rocksdb_parallelism_threads"
)]
pub
(
crate
)
rocksdb_parallelism_threads
:
usize
,
pub
(
crate
)
rocksdb_parallelism_threads
:
usize
,
#[serde(default
=
"default_rocksdb_max_log_files"
)]
#[serde(default
=
"default_rocksdb_max_log_files"
)]
...
@@ -703,6 +705,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
...
@@ -703,6 +705,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
&
self
.rocksdb_optimize_for_spinning_disks
.to_string
(),
&
self
.rocksdb_optimize_for_spinning_disks
.to_string
(),
),
),
#[cfg(feature
=
"rocksdb"
)]
#[cfg(feature
=
"rocksdb"
)]
(
"RocksDB Direct-IO"
,
&
self
.rocksdb_direct_io
.to_string
()),
#[cfg(feature
=
"rocksdb"
)]
(
"RocksDB Parallelism Threads"
,
&
self
.rocksdb_parallelism_threads
.to_string
()),
(
"RocksDB Parallelism Threads"
,
&
self
.rocksdb_parallelism_threads
.to_string
()),
#[cfg(feature
=
"rocksdb"
)]
#[cfg(feature
=
"rocksdb"
)]
(
"RocksDB Compression Algorithm"
,
&
self
.rocksdb_compression_algo
),
(
"RocksDB Compression Algorithm"
,
&
self
.rocksdb_compression_algo
),
...
...
This diff is collapsed.
Click to expand it.
src/database/rocksdb/opts.rs
+
4
−
2
View file @
5d76db8f
...
@@ -36,8 +36,10 @@ pub(crate) fn db_options(config: &Config, env: &mut Env, row_cache: &Cache, col_
...
@@ -36,8 +36,10 @@ pub(crate) fn db_options(config: &Config, env: &mut Env, row_cache: &Cache, col_
// IO
// IO
opts
.set_manual_wal_flush
(
true
);
opts
.set_manual_wal_flush
(
true
);
opts
.set_use_direct_reads
(
true
);
if
config
.rocksdb_direct_io
{
opts
.set_use_direct_io_for_flush_and_compaction
(
true
);
opts
.set_use_direct_reads
(
true
);
opts
.set_use_direct_io_for_flush_and_compaction
(
true
);
}
if
config
.rocksdb_optimize_for_spinning_disks
{
if
config
.rocksdb_optimize_for_spinning_disks
{
// speeds up opening DB on hard drives
// speeds up opening DB on hard drives
opts
.set_skip_checking_sst_file_sizes_on_db_open
(
true
);
opts
.set_skip_checking_sst_file_sizes_on_db_open
(
true
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment