change config files

dev
YuQing 2019-12-30 20:48:09 +08:00
parent 66f3fff05e
commit 8b771e37ae
5 changed files with 16 additions and 15 deletions

View File

@ -12,12 +12,13 @@ fastdfs.http_tracker_http_port = 80
fastdfs.tracker_servers = 10.0.11.201:22122,10.0.11.202:22122,10.0.11.203:22122
## Whether to open the connection pool, if not, create a new connection every time
fastdfs.connection_pool.enabled = false
fastdfs.connection_pool.enabled = true
## max_count_per_entry: max connection count per host:port , 0 is not limit
fastdfs.connection_pool.max_count_per_entry = 100
## max_count_per_entry: max connection count per host:port, 0 is not limit
fastdfs.connection_pool.max_count_per_entry = 500
## connections whose the idle time exceeds this time will be closed, unit: second,default value is 60
fastdfs.connection_pool.max_idle_time = 60
## Maximum waiting time when the maximum number of connections is reached, unit: Millisecond, default value is 5000
fastdfs.connection_pool.max_wait_time_in_ms = 5000
## connections whose the idle time exceeds this time will be closed, unit: second, default value is 3600
fastdfs.connection_pool.max_idle_time = 3600
## Maximum waiting time when the maximum number of connections is reached, unit: millisecond, default value is 1000
fastdfs.connection_pool.max_wait_time_in_ms = 1000

View File

@ -9,7 +9,7 @@ tracker_server = 10.0.11.247:22122
tracker_server = 10.0.11.248:22122
tracker_server = 10.0.11.249:22122
connection_pool.enabled = false
connection_pool.max_count_per_entry = 100
connection_pool.max_idle_time = 60
connection_pool.max_wait_time_in_ms = 5000
connection_pool.enabled = true
connection_pool.max_count_per_entry = 500
connection_pool.max_idle_time = 3600
connection_pool.max_wait_time_in_ms = 1000

View File

@ -58,8 +58,8 @@ public class ClientGlobal {
public static final boolean DEFAULT_CONNECTION_POOL_ENABLED = false;
public static final int DEFAULT_CONNECTION_POOL_MAX_COUNT_PER_ENTRY = 100;
public static final int DEFAULT_CONNECTION_POOL_MAX_IDLE_TIME = 60 ;//second
public static final int DEFAULT_CONNECTION_POOL_MAX_WAIT_TIME_IN_MS = 5000 ;//millisecond
public static final int DEFAULT_CONNECTION_POOL_MAX_IDLE_TIME = 3600 ;//second
public static final int DEFAULT_CONNECTION_POOL_MAX_WAIT_TIME_IN_MS = 1000 ;//millisecond
public static int g_connect_timeout = DEFAULT_CONNECT_TIMEOUT * 1000; //millisecond
public static int g_network_timeout = DEFAULT_NETWORK_TIMEOUT * 1000; //millisecond

View File

@ -23,7 +23,7 @@ public class ConnectionFactory {
sock.connect(socketAddress, ClientGlobal.g_connect_timeout);
return new Connection(sock, socketAddress);
} catch (Exception e) {
throw new MyException("connect to server, " + socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort() + " fail, emsg:" + e.getMessage());
throw new MyException("connect to server " + socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort() + " fail, emsg:" + e.getMessage());
}
}
}