[
https://issues.apache.org/jira/browse/AMQ-6153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15137265#comment-15137265
]
Christopher L. Shannon commented on AMQ-6153:
---------------------------------------------
Indeed it looks like setting it using socket.socketBufferSize uses a different
path. However these values are difficult to validate since all the properties
are set by reflection so I'm not sure I'd really want to try and add validation
there. In this case a 0 or negative value would cause an exception to be
thrown.
So, I would say that if you don't want to set the socketBufferSize then to make
sure you use socketBufferSize and not socket.socketBufferSize to set the
negative value. (This probably should be documented)
As far as a unit test, the change was pretty trivial so I figured I would let
the many existing transport tests run. Also, it's kind of hard to write a test
because a) if the value is 0 or -1, only a log message is printed which is hard
to assert and b) checking that the receiveBufferSize was set by the OS when
using 0 or negative is tricky because the value is up to the OS to set and can
change. Simply checking that the value is > 0 doesn't really do much since the
value is always going to be that as the underlying socket doesn't allow 0 or
negative.
> Toggle the TCP transport's ability to size a socket's read and write buffer
> ---------------------------------------------------------------------------
>
> Key: AMQ-6153
> URL: https://issues.apache.org/jira/browse/AMQ-6153
> Project: ActiveMQ
> Issue Type: Improvement
> Components: Transport
> Affects Versions: 5.12.1, 5.13.0
> Environment: Linux
> Reporter: Paul Gale
> Assignee: Christopher L. Shannon
> Priority: Minor
> Fix For: 5.14.0, 5.13.2
>
>
> This improvement only applies when running ActiveMQ on Linux.
> At the moment the TCP transport sets the size of the accepted socket's read
> and write buffer (64k by default). They can be given different sizes using
> the relevant transport connector options.
> However, on Linux once a socket has had either its read or write buffer size
> explicitly set the kernel will not automatically tune its size at run-time.
> Therefore add a new flag to instruct the TCP transport connector to not set
> the size of the socket's buffers. Said flag should default to false for
> backward compatibility.
> If the flag is true the TCP transport will ignore any configured size of the
> socket's buffers. Perhaps print a warning? This will allow the kernel to
> auto-tune the socket's buffer at run-time according to the kernel parameters
> net.ipv4.tcp_rmem and net.ipv4.tcp_wmem.
> Flag name suggestion: disableSocketBufferSizing
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)