Skip to content

Commit

Permalink
chore: disk cache load refine and reduce the info flood logs
Browse files Browse the repository at this point in the history
  • Loading branch information
BohuTANG committed May 19, 2024
1 parent ac12ad1 commit 3df2d2f
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 123 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions scripts/distribution/configs/databend-query.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ data_path = "/var/lib/databend/data"
# use "disk" to enabled disk cache
data_cache_storage = "none"

# Policy of data cache key reloading
#
# Available options: [reset|fuzzy]
# "reset": remove previous data cache during restart (default value)
# "fuzzy": reload cache keys from cache dir, retaining the cache data
# that existed before the restart

# data_cache_key_reload_policy = "fuzzy"

[cache.disk]
# cache path
path = "/var/lib/databend/cache"
Expand Down
20 changes: 19 additions & 1 deletion src/binaries/query/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,19 @@ pub async fn start_services(conf: &InnerConfig) -> Result<()> {

// Print information to users.
println!("Databend Query");

println!();
println!("Version: {}", *DATABEND_COMMIT_VERSION);

println!();
println!("Logging:");
println!(" file: {}", conf.log.file);
println!(" stderr: {}", conf.log.stderr);
println!(" otlp: {}", conf.log.otlp);
println!(" query: {}", conf.log.query);
println!(" tracing: {}", conf.log.tracing);

println!();
println!(
"Meta: {}",
if conf.meta.is_embedded_meta()? {
Expand All @@ -232,6 +236,8 @@ pub async fn start_services(conf: &InnerConfig) -> Result<()> {
format!("connected to endpoints {:#?}", conf.meta.endpoints)
}
);

println!();
println!("Memory:");
println!(" limit: {}", {
if conf.query.max_memory_limit_enabled {
Expand All @@ -246,6 +252,7 @@ pub async fn start_services(conf: &InnerConfig) -> Result<()> {
println!(" allocator: {}", GlobalAllocator::name());
println!(" config: {}", GlobalAllocator::conf());

println!();
println!("Cluster: {}", {
let cluster = ClusterDiscovery::instance().discover(conf).await?;
let nodes = cluster.nodes.len();
Expand All @@ -255,8 +262,18 @@ pub async fn start_services(conf: &InnerConfig) -> Result<()> {
"standalone".to_string()
}
});

println!();
println!("Storage: {}", conf.storage.params);
println!("Cache: {}", conf.cache.data_cache_storage.to_string());
println!("Disk cache:");
println!(" storage: {}", conf.cache.data_cache_storage.to_string());
println!(" path: {:?}", conf.cache.disk_cache_config);
println!(
" reload policy: {}",
conf.cache.data_cache_key_reload_policy.to_string()
);

println!();
println!(
"Builtin users: {}",
conf.query
Expand All @@ -267,6 +284,7 @@ pub async fn start_services(conf: &InnerConfig) -> Result<()> {
.collect::<Vec<_>>()
.join(", ")
);

println!();
println!("Admin");
println!(" listened at {}", conf.query.admin_api_address);
Expand Down
1 change: 1 addition & 0 deletions src/query/storages/common/cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ log = { workspace = true }
parking_lot = { workspace = true }
rayon = "1.9.0"
siphasher = "0.3.10"
env_logger = "0.10.2"

[dev-dependencies]
tempfile = "3.4.0"
Loading

0 comments on commit 3df2d2f

Please sign in to comment.