mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-09 22:59:59 +00:00
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:
+2
-2
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user