SOLR-10697: HttpShardHandler now uses a default of 100k as maxConnections (10k previously) and default maxConnectionsPerHost as 100k (20 previously). They are now consisent with the UpdateShardHandler defaults

This commit is contained in:
Varun Thacker 2018-09-01 07:20:15 -06:00
parent d55a81df84
commit 606e529f93
7 changed files with 24 additions and 18 deletions

View File

@ -328,6 +328,10 @@ Optimizations
in the fl (field list) parameter, we save on one doc-value lookup. This can bring performance improvements of 15%
and upwards depending on how many fields are in common. (Amrit Sarkar, Varun Thacker)
* SOLR-10697: HttpShardHandler now uses a default of 100k as maxConnections (10k previously) and default
maxConnectionsPerHost as 100k (20 previously). They are now consisent with the UpdateShardHandler defaults.
(Varun Thacker)
Other Changes
----------------------

View File

@ -36,6 +36,7 @@ import java.util.Set;
import com.google.common.base.Strings;
import org.apache.commons.io.IOUtils;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.logging.LogWatcherConfig;
@ -295,10 +296,10 @@ public class SolrXmlConfig {
boolean defined = false;
int maxUpdateConnections = UpdateShardHandlerConfig.DEFAULT_MAXUPDATECONNECTIONS;
int maxUpdateConnectionsPerHost = UpdateShardHandlerConfig.DEFAULT_MAXUPDATECONNECTIONSPERHOST;
int distributedSocketTimeout = UpdateShardHandlerConfig.DEFAULT_DISTRIBUPDATESOTIMEOUT;
int distributedConnectionTimeout = UpdateShardHandlerConfig.DEFAULT_DISTRIBUPDATECONNTIMEOUT;
int maxUpdateConnections = HttpClientUtil.DEFAULT_MAXCONNECTIONS;
int maxUpdateConnectionsPerHost = HttpClientUtil.DEFAULT_MAXCONNECTIONSPERHOST;
int distributedSocketTimeout = HttpClientUtil.DEFAULT_SO_TIMEOUT;
int distributedConnectionTimeout = HttpClientUtil.DEFAULT_CONNECT_TIMEOUT;
String metricNameStrategy = UpdateShardHandlerConfig.DEFAULT_METRICNAMESTRATEGY;
int maxRecoveryThreads = UpdateShardHandlerConfig.DEFAULT_MAXRECOVERYTHREADS;

View File

@ -93,10 +93,10 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org.
protected InstrumentedHttpRequestExecutor httpRequestExecutor;
private LBHttpSolrClient loadbalancer;
//default values:
int soTimeout = UpdateShardHandlerConfig.DEFAULT_DISTRIBUPDATESOTIMEOUT;
int connectionTimeout = UpdateShardHandlerConfig.DEFAULT_DISTRIBUPDATECONNTIMEOUT;
int maxConnectionsPerHost = 20;
int maxConnections = 10000;
int soTimeout = HttpClientUtil.DEFAULT_SO_TIMEOUT;
int connectionTimeout = HttpClientUtil.DEFAULT_CONNECT_TIMEOUT;
int maxConnectionsPerHost = HttpClientUtil.DEFAULT_MAXCONNECTIONSPERHOST;
int maxConnections = HttpClientUtil.DEFAULT_MAXCONNECTIONS;
int corePoolSize = 0;
int maximumPoolSize = Integer.MAX_VALUE;
int keepAliveTime = 5;

View File

@ -78,8 +78,8 @@ public class UpdateShardHandler implements SolrMetricProducer, SolrInfoBean {
private final Set<String> metricNames = ConcurrentHashMap.newKeySet();
private MetricRegistry registry;
private int socketTimeout = UpdateShardHandlerConfig.DEFAULT_DISTRIBUPDATESOTIMEOUT;
private int connectionTimeout = UpdateShardHandlerConfig.DEFAULT_DISTRIBUPDATECONNTIMEOUT;
private int socketTimeout = HttpClientUtil.DEFAULT_SO_TIMEOUT;
private int connectionTimeout = HttpClientUtil.DEFAULT_CONNECT_TIMEOUT;
public UpdateShardHandler(UpdateShardHandlerConfig cfg) {
updateOnlyConnectionManager = new InstrumentedPoolingHttpClientConnectionManager(HttpClientUtil.getSchemaRegisteryProvider().getSchemaRegistry());

View File

@ -16,18 +16,16 @@
*/
package org.apache.solr.update;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
public class UpdateShardHandlerConfig {
public static final int DEFAULT_DISTRIBUPDATECONNTIMEOUT = 60000;
public static final int DEFAULT_DISTRIBUPDATESOTIMEOUT = 600000;
public static final int DEFAULT_MAXUPDATECONNECTIONS = 100000;
public static final int DEFAULT_MAXUPDATECONNECTIONSPERHOST = 100000;
public static final String DEFAULT_METRICNAMESTRATEGY = "queryLessURLAndMethod";
public static final int DEFAULT_MAXRECOVERYTHREADS = -1;
public static final UpdateShardHandlerConfig DEFAULT
= new UpdateShardHandlerConfig(DEFAULT_MAXUPDATECONNECTIONS, DEFAULT_MAXUPDATECONNECTIONSPERHOST,
DEFAULT_DISTRIBUPDATESOTIMEOUT, DEFAULT_DISTRIBUPDATECONNTIMEOUT,
= new UpdateShardHandlerConfig(HttpClientUtil.DEFAULT_MAXCONNECTIONS, HttpClientUtil.DEFAULT_MAXCONNECTIONSPERHOST,
HttpClientUtil.DEFAULT_SO_TIMEOUT, HttpClientUtil.DEFAULT_CONNECT_TIMEOUT,
DEFAULT_METRICNAMESTRATEGY, DEFAULT_MAXRECOVERYTHREADS);
private final int maxUpdateConnections;

View File

@ -77,6 +77,8 @@ public class HttpClientUtil {
public static final int DEFAULT_CONNECT_TIMEOUT = 60000;
public static final int DEFAULT_SO_TIMEOUT = 600000;
public static final int DEFAULT_MAXCONNECTIONSPERHOST = 100000;
public static final int DEFAULT_MAXCONNECTIONS = 100000;
private static final int VALIDATE_AFTER_INACTIVITY_DEFAULT = 3000;
private static final int EVICT_IDLE_CONNECTIONS_DEFAULT = 50000;

View File

@ -27,6 +27,7 @@ import java.util.Properties;
import com.google.common.collect.ImmutableList;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
@ -189,8 +190,8 @@ public class TestHarness extends BaseTestHarness {
if (System.getProperty("zkHost") == null)
cloudConfig = null;
UpdateShardHandlerConfig updateShardHandlerConfig = new UpdateShardHandlerConfig(
UpdateShardHandlerConfig.DEFAULT_MAXUPDATECONNECTIONS,
UpdateShardHandlerConfig.DEFAULT_MAXUPDATECONNECTIONSPERHOST,
HttpClientUtil.DEFAULT_MAXCONNECTIONS,
HttpClientUtil.DEFAULT_MAXCONNECTIONSPERHOST,
30000, 30000,
UpdateShardHandlerConfig.DEFAULT_METRICNAMESTRATEGY, UpdateShardHandlerConfig.DEFAULT_MAXRECOVERYTHREADS);
// universal default metric reporter