Browse Source

GL, Larger blocks for socket reader (#4294)

* Adding GreenLightning

* fix missing quote

create object for json production

* turn off telemetry for default test

* allow any external domain or ip

* Update to next version and template construction

* Revert "Update to next version and template construction"

This reverts commit da4fbc3b085f6e3b3bb50283d4d6e79efffdd3bb.

* Revert "Revert "Update to next version and template construction""

This reverts commit eb05517a192554caec7c5f690eeaaab171a549b6.

* Revert "Update to next version and template construction"

This reverts commit da4fbc3b085f6e3b3bb50283d4d6e79efffdd3bb.

* fix host ip to 0.0.0.0 to take load

added database read tests

* response large enough for multi db

remove epoll, it was not helping

added required headers

* update list of which tests we have implmented

* removed unused dependency

* remove unrequired 16G memory grab to get past travis check.

* Update to next GL version to fix overload issue past 1.5M rps

Refine template method to remove dead argument

* simplify arg parse

fixed issue with multi db under heavy load

* updat to atomic int

* Removed support for MultiTest, not stable at this time.

* added clean for safety

* remove dead code

* remove old comments

* [ci fw-only Java/greenlightning]

added comment

* [ci fw-only Java/greenlightning]

Added tests for remaining multi, update and fortunes

* [ci fw-only Java/greenlightning]

disable update test, seems to be missing some writes.

* [ci fw-only Java/greenlightning]

re-test of DBUpdate

* [ci fw-only Java/greenlightning]

disabled multi and update while tracking issue

* fixed muti paylod response JSON dups.

* [ci fw-only Java/greenlightning]

narrow building

* [ci skip] update readme

* [ci fw-only Java/greenlightning]

Update to version supporting 0.0.0.0 wildcard host

* [ci fw-only Java/greenlightning]

explicit memory min/max setting instead of default

update to new maven for build

* lower required low end to 8G

* [ci fw-only Java/greenlightning]

dropped min to 6G

* [ci fw-only Java/greenlightning]

memory reduction, was using as much as 20G, paging may have slowed test

reduce pipe memory allocations

combined behaviors to reduce memory

reduce db inflight collection to reduce memory

* Revert "[ci fw-only Java/greenlightning]"

This reverts commit 47c351db1ddeb64e65801f15e3c4398d5eca84ad.

* [ci fw-only Java/greenlightning]

Was using 16-20G which may cause paging and slow results

Reduced Pipe lenghts

Reduced concurrent connections

Combined behaviors to reduce Pipe counts for more memory.

Lowered limit to 16G to know it is enforced.

* removed minimum required memory in docker file

* [ci fw-only Java/greenlightning]  Ready for merge

* [ci fw-only Java/greenlightning]

Lowering memory usage to 7G from 14G

Clean up design to be easier to read

* [ci fw-only Java/greenlightning]

Investigating pef issue, returned threads to normal priority

Reduce the new and ongoing network kernel calls

Tread Executor using hardcoded count instead of asking docker

* [ci fw-only Java/greenlightning]

remove dead code

* [ci fw-only Java/greenlightning]

Test CentOS runtime in container

Add minimal logging to track runtime issues

* Revert "[ci fw-only Java/greenlightning]"

This reverts commit 7119eaa0df0f10ac5d5d6aca4bd15e04bc89de32.

* [ci fw-only Java/greenlightning]

added centOS in container as test

added minimal logging to debug deployment

* [ci fw-only Java/greenlightning]

1G less, narrow test scope

* [ci fw-only Java/greenlightning]

streamline trie parser for headers etc

load balance based on primes to ensure even distribution

clean up ServerSocketWriter for larger blocks

Doubled ServerSocketWriters for greater volume.

* [ci fw-only Java/greenlightning]

Upgrade to Java 11 build and run pipeline

Update socket reader to optimize for greater volume

Upate pipe lengths to support greater volume

* [ci fw-only Java/greenlightning]

Double allowed limit on database connections

Bumped up to new version of GreenLightning

Doubled clock rate for reading new requests off socket

* missing version number restored

* [ci fw-only Java/greenlightning]

bump up in flight db count

* [ci fw-only Java/greenlightning]

Update to next version for larger read socket blocks
Nathan Tippy 6 years ago
parent
commit
907c5f18ef

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

@@ -4,7 +4,7 @@
 
 	<groupId>com.ociweb.gl.benchmark</groupId>
 	<artifactId>benchmark-test</artifactId>
-	<version>1.0.21</version>
+	<version>1.0.22</version>
 
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -14,7 +14,7 @@
 		<dependency>
 			<groupId>com.ociweb</groupId>
 			<artifactId>greenlightning</artifactId>
-			<version>1.0.21</version> <!-- must be a fixed version for techempower releases -->
+			<version>1.0.22</version> <!-- must be a fixed version for techempower releases -->
 		</dependency>
 		<dependency>
 			<groupId>org.slf4j</groupId>

+ 24 - 11
frameworks/Java/greenlightning/src/main/java/com/ociweb/gl/benchmark/FrameworkTest.java

@@ -31,16 +31,21 @@ public class FrameworkTest implements GreenApp {
     private int dbCallMaxResponseSize;
 	private	final int dbCallMaxResponseCount;
     private int pipelineBits;
-    private int maxQueueOut = 256;
-    private int maxConnectionBits = 13;
-	
-	private final int jsonMaxResponseCount;
-	private final int jsonMaxResponseSize;
-	
+    
+    private final int jsonMaxResponseCount;
+    private final int jsonMaxResponseSize;
+    
     private PgPoolOptions options;
     
-	public static int connectionsPerTrack =   4;
-	public static int connectionPort =        5432;
+    
+    private int maxQueueOut;
+    private int maxConnectionBits;
+    private int requestBlockSize;
+    
+    private int connectionsPerTrack;
+    private int connectionPort;
+	
+	
 	public AtomicBoolean foundDB = new AtomicBoolean(false);
 	public static String connectionHost =     "localhost";
 	public static String connectionDB =       "testdb";
@@ -55,8 +60,8 @@ public class FrameworkTest implements GreenApp {
     	this(System.getProperty("host","0.0.0.0"), 
     		 8080,    //default port for test 
     		 7,       //default concurrency per track
-    		 8*1024,  //default max rest requests allowed to queue in wait
-    		 1<<21,   //default network buffer per input socket connection
+    		 256,     //default max blocks from network, each contains multiple calls 
+    		 1<<22,   //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",
@@ -75,6 +80,8 @@ public class FrameworkTest implements GreenApp {
     		             String dbUser,
     		             String dbPass) {
     	
+    	this.connectionsPerTrack = 4;
+    	this.connectionPort = 5432;
     	this.bindPort = port;
     	this.host = host;
     	this.concurrentWritesPerChannel = concurrentWritesPerChannel;
@@ -88,6 +95,11 @@ public class FrameworkTest implements GreenApp {
     	
     	this.dbCallMaxResponseSize = 20_000; //for 500 mult db call in JSON format
     	this.jsonMaxResponseSize = 1<<9;
+
+    	this.maxQueueOut = 256;
+    	this.maxConnectionBits = 13;
+    	this.requestBlockSize = 1<<12;
+    	
     	
     	if (!"127.0.0.1".equals(System.getProperty("host",null))) { 
     		    		
@@ -116,7 +128,7 @@ public class FrameworkTest implements GreenApp {
     				.setUser(connectionUser)
     				.setIdleTimeout(20)
     				.setPassword(connectionPassword)
-    				.setCachePreparedStatements(true)    	
+    				.setCachePreparedStatements(true)
     				.setMaxSize(connectionsPerTrack);	    	
 
     		///early check to know if we have a database or not,
@@ -148,6 +160,7 @@ public class FrameworkTest implements GreenApp {
     			 .setConcurrentChannelsPerEncryptUnit(concurrentWritesPerChannel)
     			 
     			 .setMaxQueueIn(queueLengthOfPendingRequests)
+    			 .setMaxRequestSize(requestBlockSize)
     	
     			 .setMinimumInputPipeMemory(minMemoryOfInputPipes)
     			 .setMaxQueueOut(maxQueueOut)