From 9bef242b74a89d652398a0dced15073dbb9d470f Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 29 Mar 2017 21:41:21 -0400 Subject: [PATCH] ARTEMIS-1056 Adjusting Acceptor values I have been doing tests with quiver at large message sizes the tests would work really slowly without these fixes --- .../artemis/cli/commands/etc/amqp-acceptor.txt | 2 +- .../artemis/cli/commands/etc/mqtt-acceptor.txt | 2 +- .../artemis/cli/commands/etc/stomp-acceptor.txt | 2 +- .../remoting/impl/netty/TransportConstants.java | 4 ++-- .../proton/ProtonServerReceiverContext.java | 17 ++++++++--------- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt index 71f44b7112..743ba95a4b 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt @@ -1,3 +1,3 @@ - tcp://${host}:${amqp.port}?protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300 + tcp://${host}:${amqp.port}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300 diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt index ceaf615b86..a307e633d3 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt @@ -1,3 +1,3 @@ - tcp://${host}:${mqtt.port}?protocols=MQTT;useEpoll=true + tcp://${host}:${mqtt.port}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt index bfe4d8bf73..c10ab2e78e 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt @@ -1,3 +1,3 @@ - tcp://${host}:${stomp.port}?protocols=STOMP;useEpoll=true + tcp://${host}:${stomp.port}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java index 42930002bb..4317a68751 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java @@ -179,9 +179,9 @@ public class TransportConstants { public static final boolean DEFAULT_TCP_NODELAY = true; - public static final int DEFAULT_TCP_SENDBUFFER_SIZE = 32768; + public static final int DEFAULT_TCP_SENDBUFFER_SIZE = 1024 * 1024; - public static final int DEFAULT_TCP_RECEIVEBUFFER_SIZE = 32768; + public static final int DEFAULT_TCP_RECEIVEBUFFER_SIZE = 1024 * 1024; public static final boolean DEFAULT_HTTP_ENABLED = false; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java index 76ad1ace6d..fcdced4d24 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java @@ -146,11 +146,14 @@ public class ProtonServerReceiverContext extends ProtonInitializable implements public void onMessage(Delivery delivery) throws ActiveMQAMQPException { Receiver receiver; try { - receiver = ((Receiver) delivery.getLink()); if (!delivery.isReadable()) { return; } + if (delivery.isPartial()) { + return; + } + receiver = ((Receiver) delivery.getLink()); if (delivery.isPartial()) { return; @@ -160,11 +163,9 @@ public class ProtonServerReceiverContext extends ProtonInitializable implements byte[] data; - synchronized (connection.getLock()) { - data = new byte[delivery.available()]; - receiver.recv(data, 0, data.length); - receiver.advance(); - } + data = new byte[delivery.available()]; + receiver.recv(data, 0, data.length); + receiver.advance(); if (delivery.getRemoteState() instanceof TransactionalState) { @@ -174,9 +175,7 @@ public class ProtonServerReceiverContext extends ProtonInitializable implements sessionSPI.serverSend(tx, receiver, delivery, address, delivery.getMessageFormat(), data); - synchronized (connection.getLock()) { - flow(amqpCredits, minCreditRefresh); - } + flow(amqpCredits, minCreditRefresh); } catch (Exception e) { log.warn(e.getMessage(), e); Rejected rejected = new Rejected();