This commit is contained in:
Redkale
2018-08-06 19:58:19 +08:00
parent c8b0a88573
commit 9f5aa58a31

View File

@@ -69,7 +69,7 @@ public abstract class DataSqlSource<DBChannel> extends AbstractService implement
public DataSqlSource(String unitName, URL persistxml, Properties readprop, Properties writeprop) {
final AtomicInteger counter = new AtomicInteger();
this.threads = Integer.decode(readprop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Runtime.getRuntime().availableProcessors() * 16));
int maxconns = Math.max(8, Integer.decode(readprop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Runtime.getRuntime().availableProcessors() * 200)));
int maxconns = Math.max(8, Integer.decode(readprop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Math.min(1000, Runtime.getRuntime().availableProcessors() * 200))));
if (readprop != writeprop) {
this.threads += Integer.decode(writeprop.getProperty(JDBC_CONNECTIONS_LIMIT, "" + Runtime.getRuntime().availableProcessors() * 16));
maxconns = 0;