From 6b6d725820bd19244cd060cc9ef50da27ef68455 Mon Sep 17 00:00:00 2001
From: vharseko <vharseko@3a-systems.ru>
Date: Wed, 19 Jul 2023 19:45:13 +0000
Subject: [PATCH] Extend admin port connection limits (#289)

---
 opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransport.java    |    2 +-
 opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ServerTCPNIOTransport.java     |    2 +-
 opendj-server-legacy/src/main/java/org/opends/server/config/AdministrationConnector.java |    5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransport.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransport.java
index 39c0313..84232dc 100644
--- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransport.java
+++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransport.java
@@ -135,7 +135,7 @@
             // Enabled by default.
             builder.setReuseAddress(Boolean.parseBoolean(reuseAddressStr));
         }
-        builder.setMemoryManager(new PooledMemoryManager(true));
+        //builder.setMemoryManager(new PooledMemoryManager(true));
         
 
         final TCPNIOTransport transport = builder.build();
diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ServerTCPNIOTransport.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ServerTCPNIOTransport.java
index 4329cc4..285c519 100644
--- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ServerTCPNIOTransport.java
+++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ServerTCPNIOTransport.java
@@ -98,7 +98,7 @@
             builder.setReuseAddress(Boolean.parseBoolean(reuseAddressStr));
         }
         // Force usage of PooledMemoryManager which allows to use grizzly's buffers across threads.
-        builder.setMemoryManager(new PooledMemoryManager(true));
+        //builder.setMemoryManager(new PooledMemoryManager(true));
 
         final TCPNIOTransport transport = builder.build();
 
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/AdministrationConnector.java b/opendj-server-legacy/src/main/java/org/opends/server/config/AdministrationConnector.java
index 0679fe9..0e86df7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/AdministrationConnector.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/AdministrationConnector.java
@@ -48,6 +48,7 @@
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.core.ServerContext;
 import org.opends.server.core.SynchronousStrategy;
+import org.opends.server.core.WorkQueueStrategy;
 import org.opends.server.types.DirectoryException;
 import org.opends.server.types.FilePermission;
 import org.opends.server.types.InitializationException;
@@ -98,7 +99,7 @@
   /** 5 Mb. */
   private static final int ADMIN_MAX_REQUEST_SIZE = 5000000;
   private static final int ADMIN_WRITE_BUFFER_SIZE = 4096;
-  private static final int ADMIN_NUM_REQUEST_HANDLERS = 1;
+  private static final int ADMIN_NUM_REQUEST_HANDLERS = 4;
   private static final boolean ADMIN_SEND_REJECTION_NOTICE = true;
   private static final boolean ADMIN_USE_TCP_KEEP_ALIVE = true;
   private static final boolean ADMIN_USE_TCP_NO_DELAY = true;
@@ -132,7 +133,7 @@
 
     // Administration Connector uses the LDAP connection handler implementation
     adminConnectionHandler = new LDAPConnectionHandler2(
-        new SynchronousStrategy(), FRIENDLY_NAME);
+        new WorkQueueStrategy(), FRIENDLY_NAME);
     adminConnectionHandler.initializeConnectionHandler(serverContext, new LDAPConnectionCfgAdapter(config));
     adminConnectionHandler.setAdminConnectionHandler();
 

--
Gitblit v1.10.0