feat(obs): add advanced log management configuration (#2016)

Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: 安正超 <anzhengchao@gmail.com>
Co-authored-by: 唐小鸭 <tangtang1251@qq.com>
This commit is contained in:
heihutu
2026-03-01 03:23:48 +08:00
committed by GitHub
parent e7466eb1cc
commit 2c01b8c49d
26 changed files with 2560 additions and 1305 deletions
+2 -2
View File
@@ -89,7 +89,7 @@ static GLOBAL: profiling::allocator::TracingAllocator<mimalloc::MiMalloc> =
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
fn main() {
let runtime = server::get_tokio_runtime_builder()
let runtime = server::tokio_runtime_builder()
.build()
.expect("Failed to build Tokio runtime");
let result = runtime.block_on(async_main());
@@ -283,7 +283,7 @@ async fn run(config: config::Config) -> Result<()> {
// // Initialize global configuration system
let mut retry_count = 0;
while let Err(e) = ecconfig::init_global_config_sys(store.clone()).await {
error!("ecconfig::init_global_config_sys failed {:?}", e);
error!("ecstore config::init_global_config_sys failed {:?}", e);
// TODO: check error type
retry_count += 1;
if retry_count > 15 {
+1 -1
View File
@@ -31,7 +31,7 @@ pub(crate) use event::{init_event_notifier, shutdown_event_notifier};
pub(crate) use http::start_http_server;
pub(crate) use prefix::*;
pub(crate) use readiness::ReadinessGateLayer;
pub(crate) use runtime::get_tokio_runtime_builder;
pub(crate) use runtime::tokio_runtime_builder;
pub(crate) use service_state::SHUTDOWN_TIMEOUT;
pub(crate) use service_state::ServiceState;
pub(crate) use service_state::ServiceStateManager;
+8 -6
View File
@@ -80,11 +80,11 @@ fn compute_default_max_blocking_threads() -> usize {
/// Panics if environment variable values are invalid
/// # Examples
/// ```no_run
/// use rustfs_server::get_tokio_runtime_builder;
/// let builder = get_tokio_runtime_builder();
/// use rustfs_server::tokio_runtime_builder;
/// let builder = tokio_runtime_builder();
/// let runtime = builder.build().unwrap();
/// ```
pub(crate) fn get_tokio_runtime_builder() -> tokio::runtime::Builder {
pub(crate) fn tokio_runtime_builder() -> tokio::runtime::Builder {
let mut builder = tokio::runtime::Builder::new_multi_thread();
// Worker threads(Default physical cores)
@@ -136,7 +136,10 @@ pub(crate) fn get_tokio_runtime_builder() -> tokio::runtime::Builder {
});
}
if !rustfs_obs::is_production_environment() {
tracing::debug!(
println!(
"Starting Tokio runtime with configured parameters: worker_threads={}, max_blocking_threads={}, \
thread_stack_size={}, thread_keep_alive={}, global_queue_interval={}, event_interval={}, \
max_io_events_per_tick={}, thread_name={}",
worker_threads,
max_blocking_threads,
thread_stack_size,
@@ -144,8 +147,7 @@ pub(crate) fn get_tokio_runtime_builder() -> tokio::runtime::Builder {
global_queue_interval,
event_interval,
max_io_events_per_tick,
thread_name,
"Starting Tokio runtime with configured parameters"
thread_name
);
}
builder