43.4. Tuning Transport Settings

  • TCP buffer sizes. Fast networks and fast machines may get a performance boost by increasing the TCP send and receive buffer sizes. Refer to Chapter 14, Configuring the Transport for more information.

    Note

    Note that some operating systems like later versions of Linux include TCP auto-tuning and setting TCP buffer sizes manually can prevent auto-tune from working and actually give you worse performance!
  • Increase limit on file handles on the server. If a lot of concurrent connections on the servers is expected, or if clients are rapidly opening and closing connections, ensure that the user running the server has permission to create sufficient file handles.
    This varies from operating system to operating system. On Linux systems, increase the number of allowable open file handles in the file /etc/security/limits.conf, for example. add the lines
    serveruser     soft    nofile  20000
    serveruser     hard    nofile  20000
    
    This would allow up to 20 000 file handles to be open by the user serveruser.
  • Use batch-delay and set direct-deliver to false for the best throughput for very small messages. HornetQ comes with a pre-configured connector/acceptor pair (netty-throughput) in<JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-configuration.xml and JMS connection factory (ThroughputConnectionFactory) in JBOSS_DIST/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-jms.xml which can be used to give the very best throughput, especially for small messages. Refer to Chapter 14, Configuring the Transport for more information.