Hazelcast: How to Reduce Startup Time?
I have a very simple setup with only 2 nodes, using hazelcast 3.2.5. The startup time for the first node is ~ 3 seconds and the second node starts in about 10 seconds using only getTcpIpConfig. I tried to improve the startup time through
System.setProperty("hazelcast.local.localAddress", "127.0.0.1");
as suggested here but nothing has improved. Then I tried:
System.setProperty(GroupProperties.PROP_WAIT_SECONDS_BEFORE_JOIN, "1");
which reduces the start time of the 2nd node to 6 seconds.
Here is my config for both nodes:
Config cfg = new Config();
NetworkConfig nCfg = cfg.getNetworkConfig();
nCfg.getJoin().getMulticastConfig().
setEnabled(false);
nCfg.getJoin().getAwsConfig().
setEnabled(false);
nCfg.getJoin().getTcpIpConfig().
setConnectionTimeoutSeconds(5).
addMember("127.0.0.1:5701,127.0.0.1:5702").
setEnabled(true);
Most of the time is spent on SocketConnector (0.5s), TcpIpConnectionManager (2.5s) and ClusterService (2s) and elsewhere.
I would like both startup times to be below 3. Is this possible somehow?
If not, can I somehow start node, only after loading the data from the DB and then joining the cluster?
source to share
My current solution probably makes the most sense: disconnecting the lizard service from my own service and using the native Java client . In this case, the launch is less than 2 seconds.
source to share