This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Configuring nhttp.properties

The <ESB_Home>/repository/conf/nhttp.properties file contains tuning parameters related to non-blocking HTTPs. These parameters can be modified as required based on your production environment. This information is provided as reference for users who are already familiar with the product features and want to know how to configure them.

Parameters used by non-blocking HTTP transport

Parameter NameDescriptionDefault Value
http.socket.timeout

Maximum period of inactivity between two consecutive data packets. Given in milliseconds. This parameter is also defined as SO_TIMEOUT.

60000
nhttp_buffer_sizeThe size of the buffer through which data passes when receiving/transmitting NHTTP requests. This is given in bytes.8192
http.tcp.nodelayThis determines whether Nagle's algorithm (for improving the efficiency of TCP/IP by reducing the number of packets sent over the network) is used. Value 0 is used to enable this algorithm and value 1 is used to disable it. The algorithm should be enabled if you need to reduce bandwidth consumption.1
http.connection.stalecheckThis determines whether stale connection check is used. Value 0 is used to enable stale connection check and value 1 is used to disable it. When this parameter is enabled, connections which are no longer used will be identified and disabled before each request execution. Stale connection check should be disabled when performing critical operations.0

Properties for AIX based deployment

Parameter NameDescriptionDefault Value
http.nio.interest-ops-queueingDetermines whether interestOps() queueing is enabled for the I/O reactors.true

 

HTTP Sender thread pool parameters

Parameter NameDescriptionDefault Value
lst_t_coreTransport sender worker pool's initial thread count.20
lst_t_maxTransport sender worker pool's maximum thread count. Once this limit is reached and all the threads in the pool are busy, they will be in a BLOCKED state. In such situations an increase in the number of messages would fire the error  SYSTEM ALERT - HttpServerWorker threads were in BLOCKED state during last minute.100
lst_alive_secSender-side keep-alive seconds.5
lst_qlenThe sender queue length.-1
lst_io_threadsSender-side IO workers.2

When there is an increased load, it is recommended to increase the number of threads mentioned in the parameters above to balance it.

HTTP Listener thread pool parameters

Listener-side parameters should generally have the same values as the sender-side parameters.

Parameter NameDescriptionDefault Value
snd_t_coreTransport listener worker pool's initial thread count.20
snd_t_maxTransport listener worker pool's maximum thread count. Once this limit is reached and all the threads in the pool are busy, they will be in a BLOCKED state. In such situations an increase in the number of messages would fire the error  SYSTEM ALERT - HttpServerWorker threads were in BLOCKED state during last minute.100
snd_alive_secListener-side keep-alive seconds.5
snd_qlenThe listener queue length.-1
snd_io_threadsListener-side IO workers.

Other parameters

Parameter NameDescriptionDefault Value
http.block_service_listIf this parameter is set to true, all the services deployed to the WSO2 ESB cannot be viewed from the http(s):<esb>:8280/services/ URL.false

Example

The following example shows excerpts from a nhttp.properties file.

#
#        http://www.apache.org/licenses/LICENSE-2.0
#
# This file contains the configuration parameters used by the Non-blocking HTTP transport
#http.socket.timeout=60000
#nhttp_buffer_size=8192
#http.tcp.nodelay=1
#http.connection.stalecheck=0
# Uncomment the following property for an AIX based deployment
#http.nio.interest-ops-queueing=true

# HTTP Listener thread pool parameters
#snd_t_core=20
#snd_t_max=100
#snd_alive_sec=5
#snd_qlen=-1
#snd_io_threads=2

# HTTP Sender thread pool parameters
#lst_t_core=20
#lst_t_max=100
#lst_alive_sec=5
#lst_qlen=-1
#lst_io_threads=2
nhttp.rest.dispatcher.service=__MultitenantDispatcherService
# URI configurations that determine if it requires custom rest dispatcher
rest_uri_api_regex=\\w+://.+:\\d+/t/.*|\\w+://.+\\w+/t/.*|^(/t/).*
rest_uri_proxy_regex=\\w+://.+:\\d+/services/t/.*|\\w+://.+\\w+/services/t/.*|^(/services/t/).*

For information on tuning performance of WSO2 ESB using these properties, see Performance Tuning.