public static void addHttp2DefaultConfig(ChannelConfig config) { config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxConcurrentStreams, new DynamicIntProperty("server.http2.max.concurrent.streams", CommonChannelConfigKeys.maxConcurrentStreams.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.initialWindowSize, new DynamicIntProperty("server.http2.initialwindowsize", CommonChannelConfigKeys.initialWindowSize.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxHttp2HeaderTableSize, new DynamicIntProperty("server.http2.maxheadertablesize", 65536).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxHttp2HeaderListSize, new DynamicIntProperty("server.http2.maxheaderlistsize", 32768).get())); // Override this to a lower value, as we'll be using ELB TCP listeners for h2, and therefore the connection // is direct from each device rather than shared in an ELB pool. config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnection, new DynamicIntProperty("server.connection.max.requests", 4000).get())); }
public static ChannelConfig defaultChannelConfig() { ChannelConfig config = new ChannelConfig(); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxConnections, new DynamicIntProperty("server.connection.max", 20000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnection, new DynamicIntProperty("server.connection.max.requests", 20000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout, new DynamicIntProperty("server.connection.max.requests.brownout", CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.connectionExpiry, new DynamicIntProperty("server.connection.expiry", CommonChannelConfigKeys.connectionExpiry.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.idleTimeout, new DynamicIntProperty("server.connection.idle.timeout", 65 * 1000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.httpRequestReadTimeout, new DynamicIntProperty("server.http.request.read.timeout", 5000).get())); // For security, default to NEVER allowing XFF/Proxy headers from client. config.add(new ChannelConfigValue(CommonChannelConfigKeys.allowProxyHeadersWhen, StripUntrustedProxyHeadersHandler.AllowWhen.NEVER)); config.set(CommonChannelConfigKeys.withProxyProtocol, true); config.set(CommonChannelConfigKeys.preferProxyProtocolForClientIp, true); config.add(new ChannelConfigValue(CommonChannelConfigKeys.connCloseDelay, new DynamicIntProperty("zuul.server.connection.close.delay", 10).get())); return config; }
public ChainedDynamicProperty.IntProperty getChainedIntProperty(String overrideKey, String primaryKey, int defaultValue, Runnable listener) { final String mapKey = overrideKey + primaryKey; ChainedDynamicProperty.IntProperty prop = (ChainedDynamicProperty.IntProperty) fastPropMap.get(mapKey); if (prop != null) return prop; final DynamicIntProperty baseProp = new DynamicIntProperty(primaryKey, defaultValue); prop = new ChainedDynamicProperty.IntProperty(overrideKey, baseProp); fastPropMap.put(mapKey, prop); if(listener != null) { baseProp.addCallback(listener); prop.addCallback(listener); } return prop; }
public static void addHttp2DefaultConfig(ChannelConfig config) { config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxConcurrentStreams, new DynamicIntProperty("server.http2.max.concurrent.streams", CommonChannelConfigKeys.maxConcurrentStreams.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.initialWindowSize, new DynamicIntProperty("server.http2.initialwindowsize", CommonChannelConfigKeys.initialWindowSize.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxHttp2HeaderTableSize, new DynamicIntProperty("server.http2.maxheadertablesize", 65536).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxHttp2HeaderListSize, new DynamicIntProperty("server.http2.maxheaderlistsize", 32768).get())); // Override this to a lower value, as we'll be using ELB TCP listeners for h2, and therefore the connection // is direct from each device rather than shared in an ELB pool. config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnection, new DynamicIntProperty("server.connection.max.requests", 4000).get())); }
public static ChannelConfig defaultChannelConfig() { ChannelConfig config = new ChannelConfig(); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxConnections, new DynamicIntProperty("server.connection.max", 20000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnection, new DynamicIntProperty("server.connection.max.requests", 20000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout, new DynamicIntProperty("server.connection.max.requests.brownout", CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.connectionExpiry, new DynamicIntProperty("server.connection.expiry", CommonChannelConfigKeys.connectionExpiry.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.idleTimeout, new DynamicIntProperty("server.connection.idle.timeout", 65 * 1000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.httpRequestReadTimeout, new DynamicIntProperty("server.http.request.read.timeout", 5000).get())); // For security, default to NEVER allowing XFF/Proxy headers from client. config.add(new ChannelConfigValue(CommonChannelConfigKeys.allowProxyHeadersWhen, StripUntrustedProxyHeadersHandler.AllowWhen.NEVER)); config.set(CommonChannelConfigKeys.withProxyProtocol, true); config.set(CommonChannelConfigKeys.preferProxyProtocolForClientIp, true); config.add(new ChannelConfigValue(CommonChannelConfigKeys.connCloseDelay, new DynamicIntProperty("zuul.server.connection.close.delay", 10).get())); return config; }
Map<Integer, ChannelInitializer> portsToChannels = new HashMap<>(); int port = new DynamicIntProperty("zuul.server.port.main", 7001).get(); int pushPort = new DynamicIntProperty("zuul.server.port.http.push", 7008).get(); ServerSslConfig sslConfig;
Map<Integer, ChannelInitializer> portsToChannels = new HashMap<>(); int port = new DynamicIntProperty("zuul.server.port.main", 7001).get(); int pushPort = new DynamicIntProperty("zuul.server.port.http.push", 7008).get(); ServerSslConfig sslConfig;
public static void addHttp2DefaultConfig(ChannelConfig config) { config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxConcurrentStreams, new DynamicIntProperty("server.http2.max.concurrent.streams", CommonChannelConfigKeys.maxConcurrentStreams.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.initialWindowSize, new DynamicIntProperty("server.http2.initialwindowsize", CommonChannelConfigKeys.initialWindowSize.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxHttp2HeaderTableSize, new DynamicIntProperty("server.http2.maxheadertablesize", 65536).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxHttp2HeaderListSize, new DynamicIntProperty("server.http2.maxheaderlistsize", 32768).get())); // Override this to a lower value, as we'll be using ELB TCP listeners for h2, and therefore the connection // is direct from each device rather than shared in an ELB pool. config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnection, new DynamicIntProperty("server.connection.max.requests", 4000).get())); }
/** * Create a new property whose value is an integer and subject to change on-the-fly. * * @param propName property name * @param defaultValue default value if the property is not defined in underlying configuration * @param propertyChangeCallback a Runnable to be called when the property is changed */ public DynamicIntProperty getIntProperty(String propName, int defaultValue, final Runnable propertyChangeCallback) { checkAndWarn(propName); DynamicIntProperty property = new DynamicIntProperty(propName, defaultValue); addCallback(propertyChangeCallback, property); return property; }
/** * Create a new property whose value is an integer and subject to change on-the-fly. * * @param propName property name * @param defaultValue default value if the property is not defined in underlying configuration * @param propertyChangeCallback a Runnable to be called when the property is changed */ public DynamicIntProperty getIntProperty(String propName, int defaultValue, final Runnable propertyChangeCallback) { checkAndWarn(propName); DynamicIntProperty property = new DynamicIntProperty(propName, defaultValue); addCallback(propertyChangeCallback, property); return property; }
public static ChannelConfig defaultChannelConfig() { ChannelConfig config = new ChannelConfig(); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxConnections, new DynamicIntProperty("server.connection.max", 20000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnection, new DynamicIntProperty("server.connection.max.requests", 20000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout, new DynamicIntProperty("server.connection.max.requests.brownout", CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.connectionExpiry, new DynamicIntProperty("server.connection.expiry", CommonChannelConfigKeys.connectionExpiry.defaultValue()).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.idleTimeout, new DynamicIntProperty("server.connection.idle.timeout", 65 * 1000).get())); config.add(new ChannelConfigValue(CommonChannelConfigKeys.httpRequestReadTimeout, new DynamicIntProperty("server.http.request.read.timeout", 5000).get())); // For security, default to NEVER allowing XFF/Proxy headers from client. config.add(new ChannelConfigValue(CommonChannelConfigKeys.allowProxyHeadersWhen, StripUntrustedProxyHeadersHandler.AllowWhen.NEVER)); config.set(CommonChannelConfigKeys.withProxyProtocol, true); config.set(CommonChannelConfigKeys.preferProxyProtocolForClientIp, true); config.add(new ChannelConfigValue(CommonChannelConfigKeys.connCloseDelay, new DynamicIntProperty("zuul.server.connection.close.delay", 10).get())); return config; }
@Override public void initWithNiwsConfig(IClientConfig clientConfig) { super.initWithNiwsConfig(clientConfig); sizeProp = new DynamicIntProperty(clientConfig.getClientName() + "." + clientConfig.getNameSpace() + ".ServerListSubsetFilter.size", 20); eliminationPercent = new DynamicFloatProperty(clientConfig.getClientName() + "." + clientConfig.getNameSpace() + ".ServerListSubsetFilter.forceEliminatePercent", 0.1f); eliminationFailureCountThreshold = new DynamicIntProperty( clientConfig.getClientName() + "." + clientConfig.getNameSpace() + ".ServerListSubsetFilter.eliminationFailureThresold", 0); eliminationConnectionCountThreshold = new DynamicIntProperty(clientConfig.getClientName() + "." + clientConfig.getNameSpace() + ".ServerListSubsetFilter.eliminationConnectionThresold", 0); }
Monitors.registerObject(name, this); maxTotalConnectionProperty = new DynamicIntProperty(this.name + "." + config.getNameSpace() + "." + CommonClientConfigKey.MaxTotalHttpConnections.key(), DefaultClientConfigImpl.DEFAULT_MAX_TOTAL_HTTP_CONNECTIONS); maxTotalConnectionProperty.addCallback(new Runnable() { maxConnectionPerHostProperty = new DynamicIntProperty(this.name + "." + config.getNameSpace() + "." + CommonClientConfigKey.MaxHttpConnectionsPerHost.key(), DefaultClientConfigImpl.DEFAULT_MAX_HTTP_CONNECTIONS_PER_HOST); maxConnectionPerHostProperty.addCallback(new Runnable() {