|
@@ -6,6 +6,7 @@ import com.javanut.gl.api.GreenApp;
|
|
|
import com.javanut.gl.api.GreenCommandChannel;
|
|
|
import com.javanut.gl.api.GreenFramework;
|
|
|
import com.javanut.gl.api.GreenRuntime;
|
|
|
+import com.javanut.pronghorn.network.ServerSocketWriterStage;
|
|
|
|
|
|
import io.reactiverse.pgclient.PgClient;
|
|
|
import io.reactiverse.pgclient.PgPool;
|
|
@@ -19,7 +20,7 @@ public class FrameworkTest implements GreenApp {
|
|
|
private int bindPort;
|
|
|
private String host;
|
|
|
private int concurrentWritesPerChannel;
|
|
|
- private int queueLengthOfPendingRequests;
|
|
|
+
|
|
|
private int telemetryPort;//for monitoring
|
|
|
private int minMemoryOfInputPipes;
|
|
|
private int dbCallMaxResponseSize;
|
|
@@ -49,6 +50,13 @@ public class FrameworkTest implements GreenApp {
|
|
|
//TODO: add utility to compute this based on need.
|
|
|
static final int c = 592; // to reach 16K simultaneous calls
|
|
|
|
|
|
+ private final long defaultRate = Long.parseLong(System.getProperty("xx.rate", "100000"));
|
|
|
+
|
|
|
+ static {
|
|
|
+ ServerSocketWriterStage.BASE_ADJUST = Float.parseFloat(System.getProperty("xx.ratio", "1"));
|
|
|
+ ServerSocketWriterStage.HARD_LIMIT_NS = Long.parseLong(System.getProperty("xx.limitns", "100000"));
|
|
|
+ }
|
|
|
+
|
|
|
public FrameworkTest() {
|
|
|
|
|
|
// use this in commit messages to narrow travis testing to just this project
|
|
@@ -57,10 +65,9 @@ public class FrameworkTest implements GreenApp {
|
|
|
|
|
|
//this server works best with -XX:+UseNUMA
|
|
|
this(System.getProperty("host","0.0.0.0"),
|
|
|
- 8080, //default port for test
|
|
|
- c, //pipes per track
|
|
|
- c*16, //(router to module) pipeline of 16 used for plain text test
|
|
|
- 1<<15, //default total size of network buffer used by blocks
|
|
|
+ Integer.parseInt(System.getProperty("port","8080")), //default port for test
|
|
|
+ c, //pipes per track
|
|
|
+ 1<<10, // default total size of network buffer used by blocks
|
|
|
Integer.parseInt(System.getProperty("telemetry.port", "-1")),
|
|
|
"tfb-database", // jdbc:postgresql://tfb-database:5432/hello_world
|
|
|
"hello_world",
|
|
@@ -68,11 +75,15 @@ public class FrameworkTest implements GreenApp {
|
|
|
"benchmarkdbpass",
|
|
|
System.getProperty("custom.payload", "Hello, World!")
|
|
|
);
|
|
|
+
|
|
|
+ System.out.println("xx.rate "+defaultRate+" xx.ratio "+ServerSocketWriterStage.BASE_ADJUST+" xx.limitns "+ServerSocketWriterStage.HARD_LIMIT_NS);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public FrameworkTest(String host, int port,
|
|
|
int concurrentWritesPerChannel,
|
|
|
- int queueLengthOfPendingRequests,
|
|
|
+
|
|
|
int minMemoryOfInputPipes,
|
|
|
int telemetryPort,
|
|
|
String dbHost,
|
|
@@ -89,19 +100,19 @@ public class FrameworkTest implements GreenApp {
|
|
|
this.bindPort = port;
|
|
|
this.host = host;
|
|
|
this.concurrentWritesPerChannel = concurrentWritesPerChannel;
|
|
|
- this.queueLengthOfPendingRequests = queueLengthOfPendingRequests;
|
|
|
+
|
|
|
this.minMemoryOfInputPipes = minMemoryOfInputPipes;
|
|
|
this.telemetryPort = telemetryPort;
|
|
|
this.pipelineBits = 15;//max concurrent in flight database requests 1<<pipelineBits
|
|
|
|
|
|
this.dbCallMaxResponseCount = c;
|
|
|
- this.jsonMaxResponseCount = c*32;
|
|
|
+ this.jsonMaxResponseCount = c*16;
|
|
|
|
|
|
this.dbCallMaxResponseSize = 20_000; //for 500 mult db call in JSON format
|
|
|
this.jsonMaxResponseSize = 1<<8;
|
|
|
|
|
|
- this.maxQueueOut = 8*30;
|
|
|
- this.maxConnectionBits = 14; //16K connections, for test plus overhead
|
|
|
+ this.maxQueueOut = 8*20;
|
|
|
+ this.maxConnectionBits = 15;//16K connections, for test plus overhead MUST be 32K
|
|
|
|
|
|
this.maxRequestSize = 1<<9;
|
|
|
|
|
@@ -159,7 +170,7 @@ public class FrameworkTest implements GreenApp {
|
|
|
@Override
|
|
|
public void declareConfiguration(GreenFramework framework) {
|
|
|
|
|
|
- framework.setDefaultRate(100_000L);
|
|
|
+ framework.setDefaultRate(defaultRate);
|
|
|
|
|
|
//for 14 cores this is expected to use less than 16G, must use next largest prime to ensure smaller groups are not multiples.
|
|
|
framework.useHTTP1xServer(bindPort, this::parallelBehavior) //standard auto-scale
|
|
@@ -173,10 +184,10 @@ public class FrameworkTest implements GreenApp {
|
|
|
.setConcurrentChannelsPerEncryptUnit(concurrentWritesPerChannel/25) ///80) ///16) // /8)//4)
|
|
|
//TODO: we need smaller count of connections but MORE writers.
|
|
|
|
|
|
- .disableEPoll() //provides advantage in JSON test....
|
|
|
+ .disableEPoll() //provides advantage in JSON test....
|
|
|
|
|
|
- .setMaxQueueIn(queueLengthOfPendingRequests)
|
|
|
.setMaxRequestSize(maxRequestSize)
|
|
|
+ .setMaxQueueIn(c*16)
|
|
|
|
|
|
.setMinimumInputPipeMemory(minMemoryOfInputPipes)
|
|
|
.setMaxQueueOut(maxQueueOut)
|