Hi Andrea

I looked again at the YourKit profile I had taken during the tests but, for
some reason, the Disruptor methods do not show up there. That is very
starnge, but I did not have time to investigate it further. I did as you
suggested and added an option to disable the Disruptor
PushPullBlockingQueue and revert to the Java concurrent ArrayBlockingQueue
(patch below). I run the tests again with the (slow) Oracle datasource and
the results were way better, like only half the CPU previously required.

Good to know that you added some more performance improvements! What other
Disruptor queue variant you changed to? As far as I understood from the
Disruptor documentation, the PushPullBlockingQueue is the most efficient
variant that is fully compatible with the Java BlockingQueue interface.

I think, at least in our scenarios, the previous implementation will be
required anyway. Do you think you could incorporate the patch below as
well? I could try to do a PR, but I have never done that before and would
first need to understand the GeoTools development process.

Regards,
Joao

>>>
diff --git
a/modules/library/render/src/main/java/org/geotools/renderer/lite/StreamingRenderer.java
b/modules/library/render/src/main/java/org/geotools/renderer/lite/StreamingRenderer.java
index 7ecd12629e..4c1fc242a8 100644
---
a/modules/library/render/src/main/java/org/geotools/renderer/lite/StreamingRenderer.java
+++
b/modules/library/render/src/main/java/org/geotools/renderer/lite/StreamingRenderer.java
@@ -44,6 +44,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Spliterator;
+import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
@@ -185,6 +186,10 @@ public class StreamingRenderer implements GTRenderer {

     private static final int defaultMaxFiltersToSendToDatastore = 5; //
default

+    private static final boolean DISABLE_DISRUPTOR =
+            Boolean.parseBoolean(
+
System.getProperty("org.geotools.renderer.lite.disableDisruptor", "false"));
+
     /**
      * Computes the scale as the ratio between map distances and real
world distances, assuming
      * 90dpi and taking into consideration projection deformations and
actual earth shape. <br>
@@ -3765,10 +3770,14 @@ public class StreamingRenderer implements
GTRenderer {
     public class RenderingBlockingQueue implements
BlockingQueue<RenderingRequest> {
         private static final long serialVersionUID = 4908029658595573833L;

-        PushPullBlockingQueue<RenderingRequest> delegate;
+        BlockingQueue<RenderingRequest> delegate;

         public RenderingBlockingQueue(int capacity) {
-            this.delegate = new PushPullBlockingQueue<>(capacity);
+            if (DISABLE_DISRUPTOR) {
+                this.delegate = new ArrayBlockingQueue<>(capacity);
+            } else {
+                this.delegate = new PushPullBlockingQueue<>(capacity);
+            }
         }

         @Override
<<<
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to