Normally only one connection to the remote server is required to send XMPP stanza to that server. In some cases however, under a high load, you can get much better throughput and performance if you open multiple connections to the remote server.
This is especially true when the remote server works in a cluster mode. Ideally you want to open a connection to each of the cluster nodes on the remote server. This way you can spread the traffic evenly among cluster nodes and improve the performance for s2s connections.
Tigase server offers 2 different parameters to tweak the number of concurrent, s2s connections:
-
max-out-total-conns
- this property specifies the maximum outgoing connections the Tigase server opens to any remote XMPP server. This is a per domain limit, which means that this limit applies to each of the remote domains Tigase connects to. If it is set to4
then Tigase opens a maximum of 4 connections tojabber.org
plus maximum 4 connections tomuc.jabber.org
even if this is the same physical server behind the same IP address.To adjust the limit you have to add following to the
config.tdsl
file:s2s { 'max-out-total-conns' = 2 }
-
max-out-per-ip-conns
- this property specifies the maximum outgoing connections Tigase server opens to any remote XMPP server to its single IP address. This too, is per domain limit, which means that this limit applies to each of the remote domains Tigase connects to. If it is set to1
, and the above limit is set to4
, and the remote server is visible behind 1 IP address, then Tigase opens a maximum of 1 connection tojabber.org
plus a maximum of 1 connection tomuc.jabber.org
and other subdomains.To adjust the limit you have to add following line to the
config.tdsl
file:s2s { 'max-out-per-ip-conns' = 2 }