diff --git a/src/chassis-mainloop.h b/src/chassis-mainloop.h index c6f7a60..e9cfaf6 100644 --- a/src/chassis-mainloop.h +++ b/src/chassis-mainloop.h @@ -68,6 +68,7 @@ typedef struct chassis chassis; #define MAX_DIST_TRAN_PREFIX 64 #define DEFAULT_LIVE_TIME 7200 +#define DEFAULT_POOL_SIZE 10 #define MAX_ALLOWED_PACKET_CEIL (1 * GB) #define MAX_ALLOWED_PACKET_DEFAULT (32 * MB) #define MAX_ALLOWED_PACKET_FLOOR (1 * KB) diff --git a/src/chassis-options-utils.c b/src/chassis-options-utils.c index b0d61b2..07f130c 100644 --- a/src/chassis-options-utils.c +++ b/src/chassis-options-utils.c @@ -454,7 +454,7 @@ show_default_pool_size(gpointer param) { return g_strdup_printf("%d", srv->mid_idle_connections); } if (CAN_SAVE_OPTS_PROPERTY(opt_type)) { - if (srv->mid_idle_connections == 100) { + if (srv->mid_idle_connections == DEFAULT_POOL_SIZE) { return NULL; } return g_strdup_printf("%d", srv->mid_idle_connections); @@ -473,8 +473,8 @@ assign_default_pool_size(const gchar *newval, gpointer param) { gint value = 0; if (try_get_int_value(newval, &value)) { if (value >= 0) { - if (value < 10) { - value = 10; + if (value < DEFAULT_POOL_SIZE) { + value = DEFAULT_POOL_SIZE; } srv->mid_idle_connections = value; diff --git a/src/mysql-proxy-cli.c b/src/mysql-proxy-cli.c index 780acfa..6757609 100644 --- a/src/mysql-proxy-cli.c +++ b/src/mysql-proxy-cli.c @@ -190,7 +190,7 @@ chassis_frontend_new(void) frontend->is_client_compress_support = 0; frontend->xa_log_detailed = 0; - frontend->default_pool_size = 10; + frontend->default_pool_size = DEFAULT_POOL_SIZE; frontend->worker_processes = 1; frontend->max_resp_len = 10 * 1024 * 1024; /* 10M */ frontend->max_alive_time = DEFAULT_LIVE_TIME; @@ -701,8 +701,8 @@ init_parameters(struct chassis_frontend_t *frontend, chassis *srv) g_message("set worker processes:%d", srv->worker_processes); - if (frontend->default_pool_size < 10) { - frontend->default_pool_size = 10; + if (frontend->default_pool_size < DEFAULT_POOL_SIZE) { + frontend->default_pool_size = DEFAULT_POOL_SIZE; } srv->mid_idle_connections = frontend->default_pool_size;