ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/28] ignite git commit: Set default queue limit to 0 in communication.
Date Thu, 08 Dec 2016 13:17:05 GMT
Set default queue limit to 0 in communication.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/622f045a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/622f045a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/622f045a

Branch: refs/heads/ignite-4371
Commit: 622f045aad7c39d9cda3c9154758351d5f1d4d8f
Parents: 0757318
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Thu Dec 8 13:38:00 2016 +0700
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Thu Dec 8 13:38:00 2016 +0700

----------------------------------------------------------------------
 .../core/src/main/java/org/apache/ignite/BenchAtomic.java   | 2 +-
 .../org/apache/ignite/internal/util/nio/GridNioServer.java  | 2 +-
 .../ignite/spi/communication/tcp/TcpCommunicationSpi.java   | 9 +++++++--
 3 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/622f045a/modules/core/src/main/java/org/apache/ignite/BenchAtomic.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/BenchAtomic.java b/modules/core/src/main/java/org/apache/ignite/BenchAtomic.java
index fdaf56c..dd4dbcf 100644
--- a/modules/core/src/main/java/org/apache/ignite/BenchAtomic.java
+++ b/modules/core/src/main/java/org/apache/ignite/BenchAtomic.java
@@ -62,7 +62,7 @@ public class BenchAtomic {
         String locHost = System.getProperty("LOC_HOST");
         int msgQLim = Integer.getInteger(
             "MSG_Q_LIM",
-            1024);
+            0);
         final boolean ioTest = Boolean.getBoolean("IO_TEST");
         final boolean ioTestNio = Boolean.getBoolean("IO_TEST_NIO");
         final int connPairs = Integer.getInteger("CONN_PAIRS", 1);

http://git-wip-us.apache.org/repos/asf/ignite/blob/622f045a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 4dd03a1..bc1f173 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -97,7 +97,7 @@ public class GridNioServer<T> {
     public static final int DFLT_SES_WRITE_TIMEOUT = 5000;
 
     /** Default send queue limit. */
-    public static final int DFLT_SEND_QUEUE_LIMIT = 1024;
+    public static final int DFLT_SEND_QUEUE_LIMIT = 0;
 
     /** Time, which server will wait before retry operation. */
     private static final long ERR_WAIT_TIME = 2000;

http://git-wip-us.apache.org/repos/asf/ignite/blob/622f045a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index c08939c..b16169c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -313,7 +313,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
     public static final boolean DFLT_TCP_NODELAY = true;
 
     /** Default received messages threshold for sending ack. */
-    public static final int DFLT_ACK_SND_THRESHOLD = 16;
+    public static final int DFLT_ACK_SND_THRESHOLD = 32;
 
     /** Default socket write timeout. */
     public static final long DFLT_SOCK_WRITE_TIMEOUT = 2000;
@@ -1869,6 +1869,11 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                 ", slowClientQueueLimit=" + slowClientQueueLimit + ']');
         }
 
+        if (msgQueueLimit == 0)
+            U.quietAndWarn(log, "Message queue limit is set to 0 which may lead to " +
+                "potential OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC
modes " +
+                "due to message queues growth on sender and reciever sides.");
+
         registerMBean(gridName, this, TcpCommunicationSpiMBean.class);
 
         connectGate = new ConnectGateway();
@@ -3339,7 +3344,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
         if (recovery == null) {
             int maxSize = Math.max(msgQueueLimit, ackSndThreshold);
 
-            int queueLimit = unackedMsgsBufSize != 0 ? unackedMsgsBufSize : (maxSize * 5);
+            int queueLimit = unackedMsgsBufSize != 0 ? unackedMsgsBufSize : (maxSize * 128);
 
             GridNioRecoveryDescriptor old = recoveryDescs.putIfAbsent(key,
                 recovery = new GridNioRecoveryDescriptor(pairedConnections, queueLimit, node,
log));


Mime
View raw message