Browse Source

GL, version upgrade and pipeline cleanups. (#4980)

* [ci fw-only Java/greenlightning]

swap versions

* [ci fw-only Java/greenlightning]

go back to simple file

* [ci fw-only Java/greenlightning]

update version to add loging and track issue

* [ci fw-only Java/greenlightning]

use old update design

bump version number

* [ci fw-only Java/greenlightning]

reduce poll rate for greater volume

* [ci fw-only Java/greenlightning]

update comment

* [ci fw-only Java/greenlightning]

update for larger pipes

* [ci fw-only Java/greenlightning]

update memory limit

update to next version

better request read

* [ci fw-only Java/greenlightning]

next version and buffer size adjustments

cleaned up object creation for JSON request
Nathan Tippy 6 years ago
parent
commit
258edfb2e7

+ 4 - 4
frameworks/Java/greenlightning/README.md

@@ -1,15 +1,15 @@
 
 
 # GreenLightning Benchmarking Test
 # GreenLightning Benchmarking Test
+# [email protected]
 
 
 ### Test Type Implementation Source Code
 ### Test Type Implementation Source Code
 
 
-* [JSON](src/main/java/com/ociweb/gl/benchmark)
-* [PLAINTEXT](src/main/java/com/ociweb/gl/benchmark)
+* [JSON](src/main/java/com/javanut/gl/benchmark)
+* [PLAINTEXT](src/main/java/com/javanut/gl/benchmark)
 
 
 ## Important Libraries
 ## Important Libraries
 The tests were run with:
 The tests were run with:
-* [Software](https://oci-pronghorn.gitbook.io/greenlightning/)
-* [Example](https://github.com/oci-pronghorn/GreenLightning/tree/master/slipstream)
+* [Example](https://github.com/nathantippy/GreenLightning/tree/master/slipstream)
 
 
 ### Implemented benchmarks
 ### Implemented benchmarks
 - [x] JSON serialization
 - [x] JSON serialization

+ 1 - 1
frameworks/Java/greenlightning/pom.xml

@@ -4,7 +4,7 @@
 
 
 	<groupId>com.javanut.gl.benchmark</groupId>
 	<groupId>com.javanut.gl.benchmark</groupId>
 	<artifactId>benchmark-test</artifactId>
 	<artifactId>benchmark-test</artifactId>
-	<version>1.1.7</version> 
+	<version>1.1.8</version> 
 
 
 	<properties>
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 9 - 7
frameworks/Java/greenlightning/src/main/java/com/javanut/gl/benchmark/FrameworkTest.java

@@ -15,7 +15,7 @@ import io.reactiverse.pgclient.PgPoolOptions;
 public class FrameworkTest implements GreenApp {
 public class FrameworkTest implements GreenApp {
 
 
 	private final String payloadText;
 	private final String payloadText;
-	private final byte[] payload;
+	final byte[] payload;
 
 
 	private int bindPort;
 	private int bindPort;
     private String host;
     private String host;
@@ -48,13 +48,15 @@ public class FrameworkTest implements GreenApp {
 	public static String connectionPassword = "postgres";
 	public static String connectionPassword = "postgres";
 	
 	
 	//TODO: add utility to compute this based on need.
 	//TODO: add utility to compute this based on need.
-	static final int c = 592; // to reach 16K simultaneous calls
+	static final int c = 148;//592; // to reach 16K simultaneous calls
 
 
-	private final long defaultRate = Long.parseLong(System.getProperty("xx.rate", "100000")); 
+	private final long defaultRate = Long.parseLong(System.getProperty("xx.rate", "200000")); //2.5K cycles per second
+	                                                                                          // at 512 requests is 1.28M/sec
+	
 	
 	
 	static {
 	static {
 		ServerSocketWriterStage.BASE_ADJUST = Float.parseFloat(System.getProperty("xx.ratio", "1"));
 		ServerSocketWriterStage.BASE_ADJUST = Float.parseFloat(System.getProperty("xx.ratio", "1"));
-		ServerSocketWriterStage.HARD_LIMIT_NS = Long.parseLong(System.getProperty("xx.limitns", "100000"));		
+		ServerSocketWriterStage.HARD_LIMIT_NS = Long.parseLong(System.getProperty("xx.limitns", "200000"));		
 	}
 	}
 	
 	
     public FrameworkTest() {
     public FrameworkTest() {
@@ -67,7 +69,7 @@ public class FrameworkTest implements GreenApp {
     	this(System.getProperty("host","0.0.0.0"), 
     	this(System.getProperty("host","0.0.0.0"), 
     		 Integer.parseInt(System.getProperty("port","8080")),    	//default port for test 
     		 Integer.parseInt(System.getProperty("port","8080")),    	//default port for test 
     		 c,         //pipes per track    			 
     		 c,         //pipes per track    			 
-    		 1<<10,     // default total size of network buffer used by blocks  
+    		 1<<16,     // default total size of network buffer used by blocks  
     		 Integer.parseInt(System.getProperty("telemetry.port", "-1")),
     		 Integer.parseInt(System.getProperty("telemetry.port", "-1")),
     		 "tfb-database", // jdbc:postgresql://tfb-database:5432/hello_world
     		 "tfb-database", // jdbc:postgresql://tfb-database:5432/hello_world
     		 "hello_world",
     		 "hello_world",
@@ -106,7 +108,7 @@ public class FrameworkTest implements GreenApp {
     	this.pipelineBits = 15;//max concurrent in flight database requests 1<<pipelineBits
     	this.pipelineBits = 15;//max concurrent in flight database requests 1<<pipelineBits
     	            
     	            
     	this.dbCallMaxResponseCount = c;
     	this.dbCallMaxResponseCount = c;
-    	this.jsonMaxResponseCount = c*16;
+    	this.jsonMaxResponseCount = c*16*4;
     	
     	
     	this.dbCallMaxResponseSize = 20_000; //for 500 mult db call in JSON format
     	this.dbCallMaxResponseSize = 20_000; //for 500 mult db call in JSON format
     	this.jsonMaxResponseSize = 1<<8;
     	this.jsonMaxResponseSize = 1<<8;
@@ -187,7 +189,7 @@ public class FrameworkTest implements GreenApp {
     			 .disableEPoll() //provides advantage in JSON test.... 
     			 .disableEPoll() //provides advantage in JSON test.... 
  						 
  						 
     			 .setMaxRequestSize(maxRequestSize)
     			 .setMaxRequestSize(maxRequestSize)
-    			 .setMaxQueueIn(c*16)
+    			 .setMaxQueueIn(c*16*4)
     	
     	
     			 .setMinimumInputPipeMemory(minMemoryOfInputPipes)
     			 .setMinimumInputPipeMemory(minMemoryOfInputPipes)
     			 .setMaxQueueOut(maxQueueOut)
     			 .setMaxQueueOut(maxQueueOut)

+ 13 - 0
frameworks/Java/greenlightning/src/main/java/com/javanut/gl/benchmark/RequestObject.java

@@ -0,0 +1,13 @@
+package com.javanut.gl.benchmark;
+
+import com.javanut.gl.api.HTTPRequestReader;
+import com.javanut.pronghorn.pipe.StructuredReader;
+
+public class RequestObject {
+
+	public RequestObject(HTTPRequestReader request) {
+		StructuredReader reader = request.structured();
+		
+	}
+
+}

+ 11 - 15
frameworks/Java/greenlightning/src/main/java/com/javanut/gl/benchmark/SimpleRest.java

@@ -13,35 +13,31 @@ public class SimpleRest implements RestMethodListener {
 	private final byte[] messageBytes = "message".getBytes();
 	private final byte[] messageBytes = "message".getBytes();
 	private final byte[] payload;
 	private final byte[] payload;
 	private final HTTPResponseService responseService;
 	private final HTTPResponseService responseService;
-	
+	private final JSONRenderer<RequestObject> renderJSON;
+		
 	public SimpleRest(GreenRuntime runtime, int maxResponseCount, int maxResponseSize, byte[] payload) {
 	public SimpleRest(GreenRuntime runtime, int maxResponseCount, int maxResponseSize, byte[] payload) {
 		this.payload = payload;
 		this.payload = payload;
 		this.responseService = runtime
 		this.responseService = runtime
 				.newCommandChannel()
 				.newCommandChannel()
-				.newHTTPResponseService(maxResponseCount, maxResponseSize);		
+				.newHTTPResponseService(maxResponseCount, maxResponseSize);	
+		
+		this.renderJSON = new JSONRenderer<RequestObject>()
+				.startObject()
+				.string(messageBytes, (o,t) -> t.write(payload) )
+				.endObject();
+		
 	}
 	}
 	
 	
 
 
-//	JSONRenderer<HTTPRequestReader> renderJSON = new JSONRenderer<HTTPRequestReader>()
-//			.startObject()
-//			.string(messageBytes, (o,t) -> t.write(FrameworkTest.payload) )
-//			.endObject();
 	
 	
 	public boolean jsonRestRequest(HTTPRequestReader request) {
 	public boolean jsonRestRequest(HTTPRequestReader request) {
 	
 	
 		//this check is to postpone the work if the network has become saturated
 		//this check is to postpone the work if the network has become saturated
 		if (responseService.hasRoomFor(1)) {
 		if (responseService.hasRoomFor(1)) {
-			//NOTE: this is only done here for the framework test
-			//      in a normal production deployment this JSONRender will only
-			//      be created once and held as a member.
-			JSONRenderer<HTTPRequestReader> renderJSON = new JSONRenderer<HTTPRequestReader>()
-					.startObject()
-					.string(messageBytes, (o,t) -> t.write(payload) )
-					.endObject();
-			
+
 			return responseService.publishHTTPResponse(request, 
 			return responseService.publishHTTPResponse(request, 
 					                            HTTPContentTypeDefaults.JSON,
 					                            HTTPContentTypeDefaults.JSON,
-					                            w -> renderJSON.render(w,request)
+					                            w -> renderJSON.render(w,new RequestObject(request))
 					                            );
 					                            );
 		} else {
 		} else {
 			return false;
 			return false;