Version 10.5.0.15 of the nsqcmems.jar file was distributed with Nav_Server_10.5.0.12.
In nsqcmems.jar version 10.5.0.15 and higher, we limit the number of EMS servers that nsqcmems.jar can connect to simultaneously. By default, nsqcmems.jar will attempt to connect to 10 servers at once, but you can override this with the property simultaneous.connects
in nsqcmems.properties.
Let's say some of your EMS servers are staying in an unknown state. This indicates that one or more of the connections are slow and interfering with the other servers that are attempting to connect at the same time. With previous versions of the nsqcmems.jar, you may have resolved this by spinning off those servers in a separate instance of nsqcmems.jar.
But with nsqcmems.jar versions 10.5.0.15 and higher, you have the ability to limit the number of servers that attempt to connect at the same time. With such a limit in place, the servers with the slower connections don't affect other servers that are finishing the connect handshake. We will use 5 as an example:
simultaneous.connects=5
In this example, only 5 servers are allowed to try to connect at one time. So even if one server connection is slow, there is more bandwidth for the other 4 servers to finish their connection handshakes.
Lowering the connect wait time
Once we bring the simultaneous.connects
value much lower, we might want nsqcmems.jar to be more aggressive when seeing if a slot is available for another server to connect. This can be controlled by a second property in nsqcmems.properties called connect.wait.msec
. This property controls how long a connection waits to see if there is an open slot in the number of simultaneous.connects
. By default the value is 500 ms, which is half a second.
Staying with the above example, let's say we have limited the number of simultaneous connections but we still have some EMS brokers in an unknown state. Now we just want them to connect one at a time.
simultaneous.connects=1
connect.wait.msec=100
Because we are limiting the connections to one at a time, we want nsqcmems to be aggressive when checking whether another server can start the connect process. So we lower the length of time it waits to see if there is an open slot.
Lowering the connect.wait.msec
value too low will heavily increase the CPU usage during startup and unmanage/manage when the nsqcmems.jar is attempting to connect to all servers.