多线程下载文件到本地持续一到两天后Timeout waiting for connection from pool
egosodv opened this issue · 1 comments
egosodv commented
我在使用多线程下载oss上的大量小文件,ossclient是用的单例,一开始是默认参数报错
看网上关于这个报错是连接池参数配置的问题,所以我把参数设置成如下尽可能大的值,仍然会报错,可以稳定复现
使用的sdk版本 com.aliyun.oss:aliyun-sdk-oss:3.17.2
java8
window server2008
private static OSS OSSCLIENT;
public static OSS getClient() {
if (OSSCLIENT == null) {
ClientBuilderConfiguration clientConfiguration = new ClientBuilderConfiguration();
clientConfiguration.setConnectionRequestTimeout(20000);
clientConfiguration.setConnectionTimeout(20000);
clientConfiguration.setSocketTimeout(20000);
clientConfiguration.setConnectionTTL(60000);
clientConfiguration.setMaxConnections(2048);
OSSCLIENT = new OSSClientBuilder().build(ENDPOINT, credentialsProvider,clientConfiguration);
}
return OSSCLIENT;
}
egosodv commented
有大量close wait的连接