This is an automated email from the ASF dual-hosted git repository. burcham pushed a commit to branch sni in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git
The following commit(s) were added to refs/heads/sni by this push: new 2742651 set well-known port on servers for SNI 2742651 is described below commit 27426517c4ffb9a810fd18dd6b3c38268ef34466 Author: Bill Burcham <bburc...@pivotal.io> AuthorDate: Sat May 23 12:31:45 2020 -0700 set well-known port on servers for SNI --- .../main/java/org/apache/geode/benchmark/tasks/StartServer.java | 2 +- .../java/org/apache/geode/benchmark/tasks/StartServerSNI.java | 8 ++++++-- .../benchmark/topology/ClientServerTopologyWithSNIProxy.java | 3 ++- .../src/main/java/org/apache/geode/benchmark/topology/Ports.java | 8 ++++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java index 3ebd62f..d2bd9ef 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java @@ -84,8 +84,8 @@ public class StartServer implements Task { */ protected void configureCacheServer(final CacheServer cacheServer, final TestContext context) throws UnknownHostException { - cacheServer.setPort(0); cacheServer.setMaxConnections(Integer.MAX_VALUE); + cacheServer.setPort(0); } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServerSNI.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServerSNI.java index 1ce09b4..73d88fe 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServerSNI.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServerSNI.java @@ -10,14 +10,18 @@ import org.apache.geode.perftest.TestContext; public class StartServerSNI extends StartServer { - public StartServerSNI(final int locatorPort) { + private final int serverPortForSni; + + public StartServerSNI(final int locatorPort, final int serverPortForSni) { super(locatorPort); + this.serverPortForSni = serverPortForSni; } @Override protected void configureCacheServer(final CacheServer cacheServer, final TestContext context) throws UnknownHostException { - super.configureCacheServer(cacheServer, context); + cacheServer.setMaxConnections(Integer.MAX_VALUE); + cacheServer.setPort(serverPortForSni); cacheServer.setHostnameForClients( getOffPlatformHostName(context, InetAddress.getLocalHost())); } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java index 7f0439d..10a089f 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java @@ -21,6 +21,7 @@ import static org.apache.geode.benchmark.Config.role; import static org.apache.geode.benchmark.parameters.Utils.addToTestConfig; import static org.apache.geode.benchmark.parameters.Utils.configureGeodeProductJvms; import static org.apache.geode.benchmark.topology.Ports.LOCATOR_PORT; +import static org.apache.geode.benchmark.topology.Ports.SERVER_PORT_FOR_SNI; import static org.apache.geode.benchmark.topology.RoleKinds.GEODE_PRODUCT; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.LOCATOR; @@ -73,7 +74,7 @@ public class ClientServerTopologyWithSNIProxy { .forEach(role -> before(config, new DefineHostNamingsOffPlatformTask(), role)); before(config, new StartLocatorSNI(LOCATOR_PORT), LOCATOR); - before(config, new StartServerSNI(LOCATOR_PORT), SERVER); + before(config, new StartServerSNI(LOCATOR_PORT, SERVER_PORT_FOR_SNI), SERVER); before(config, new StartSniProxy(LOCATOR_PORT), PROXY); before(config, new StartClientSNI(LOCATOR_PORT), CLIENT); diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Ports.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Ports.java index 1e40182..205481e 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Ports.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Ports.java @@ -19,4 +19,12 @@ public class Ports { * The port used to create the locator for the tests */ public static final int LOCATOR_PORT = 10334; + + /** + * With an SNI proxy, both the locator ports and the server ports + * have to be well-known (static) since the proxy has to know them + * and, in general, SNI proxies don't have visibility into locator + * responses carrying server port numbers. + */ + public static final int SERVER_PORT_FOR_SNI = 40404; }