add sample.conf
parent
de94afb9db
commit
bbc7e78e05
|
|
@ -0,0 +1,70 @@
|
||||||
|
# connect timeout in seconds
|
||||||
|
# default value is 10s
|
||||||
|
connect_timeout = 2
|
||||||
|
|
||||||
|
# network timeout in seconds
|
||||||
|
# default value is 30s
|
||||||
|
network_timeout = 60
|
||||||
|
|
||||||
|
# the base path to store data and log files
|
||||||
|
base_path = /tmp
|
||||||
|
|
||||||
|
# bind an address of this host for inner port
|
||||||
|
# empty for bind all addresses of this host
|
||||||
|
inner_bind_addr =
|
||||||
|
|
||||||
|
# bind an address of this host for outer port
|
||||||
|
# empty for bind all addresses of this host
|
||||||
|
outer_bind_addr =
|
||||||
|
|
||||||
|
# the internal server port
|
||||||
|
inner_port = 5607
|
||||||
|
|
||||||
|
# the outer server port
|
||||||
|
outer_port = 5608
|
||||||
|
|
||||||
|
# max concurrent connections this server supported
|
||||||
|
# default value is 256
|
||||||
|
max_connections = 1024
|
||||||
|
|
||||||
|
# accept thread count
|
||||||
|
# default value is 1
|
||||||
|
accept_threads = 1
|
||||||
|
|
||||||
|
# work thread count
|
||||||
|
# default value is 4
|
||||||
|
work_threads = 16
|
||||||
|
|
||||||
|
min_buff_size = 4KB
|
||||||
|
|
||||||
|
max_buff_size = 64KB
|
||||||
|
|
||||||
|
# max pkg size
|
||||||
|
# default value is 16K
|
||||||
|
max_pkg_size = 64KB
|
||||||
|
|
||||||
|
# thread stack size, should >= 64KB
|
||||||
|
# default value is 64KB
|
||||||
|
thread_stack_size = 256KB
|
||||||
|
|
||||||
|
#unix group name to run this program,
|
||||||
|
#not set (empty) means run by the group of current user
|
||||||
|
run_by_group =
|
||||||
|
|
||||||
|
#unix username to run this program,
|
||||||
|
#not set (empty) means run by current user
|
||||||
|
run_by_user =
|
||||||
|
|
||||||
|
# sync log buff to disk every interval seconds
|
||||||
|
# default value is 10 seconds
|
||||||
|
sync_log_buff_interval = 10
|
||||||
|
|
||||||
|
# if rotate the error log every day
|
||||||
|
# default value is false
|
||||||
|
rotate_error_log = true
|
||||||
|
|
||||||
|
# keep days of the log files
|
||||||
|
# 0 means do not delete old log files
|
||||||
|
# default value is 0
|
||||||
|
log_file_keep_days = 7
|
||||||
|
|
||||||
|
|
@ -271,3 +271,33 @@ int sf_load_config(const char *server_name, const char *filename,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sf_log_config()
|
||||||
|
{
|
||||||
|
logInfo("base_path=%s, inner_port=%d, inner_bind_addr=%s, "
|
||||||
|
"outer_port=%d, outer_bind_addr=%s, "
|
||||||
|
"max_connections=%d, accept_threads=%d, work_threads=%d, "
|
||||||
|
"connect_timeout=%d, network_timeout=%d, thread_stack_size=%d, "
|
||||||
|
"max_pkg_size=%d, min_buff_size=%d, max_buff_size=%d, "
|
||||||
|
"sync_log_buff_interval=%d, rotate_error_log=%d, "
|
||||||
|
"log_file_keep_days=%d, run_by_group=%s, run_by_user=%s",
|
||||||
|
g_sf_global_vars.base_path,
|
||||||
|
g_sf_global_vars.inner_port,
|
||||||
|
g_sf_global_vars.inner_bind_addr,
|
||||||
|
g_sf_global_vars.outer_port,
|
||||||
|
g_sf_global_vars.outer_bind_addr,
|
||||||
|
g_sf_global_vars.max_connections,
|
||||||
|
g_sf_global_vars.accept_threads,
|
||||||
|
g_sf_global_vars.work_threads,
|
||||||
|
g_sf_global_vars.connect_timeout,
|
||||||
|
g_sf_global_vars.network_timeout,
|
||||||
|
g_sf_global_vars.thread_stack_size,
|
||||||
|
g_sf_global_vars.max_pkg_size,
|
||||||
|
g_sf_global_vars.min_buff_size,
|
||||||
|
g_sf_global_vars.max_buff_size,
|
||||||
|
g_sf_global_vars.sync_log_buff_interval,
|
||||||
|
g_sf_global_vars.rotate_error_log,
|
||||||
|
g_sf_global_vars.log_file_keep_days,
|
||||||
|
g_sf_global_vars.run_by_group,
|
||||||
|
g_sf_global_vars.run_by_user
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,8 @@ int sf_load_config(const char *server_name, const char *filename,
|
||||||
IniContext *pIniContext, const int default_inner_port,
|
IniContext *pIniContext, const int default_inner_port,
|
||||||
const int default_outer_port);
|
const int default_outer_port);
|
||||||
|
|
||||||
|
void sf_log_config();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue