Karussell
Karussell

Reputation: 17375

Hazelcast: How to decrease startup time?

I've a very simple setup of only two nodes, using hazelcast 3.2.5. The startup time for the first node is ~3 seconds and the second node starts in roughly 10 sec using only getTcpIpConfig. I've tried to improve the startup time via

System.setProperty("hazelcast.local.localAddress", "127.0.0.1");

as suggested here but nothing improved. Then I tried:

System.setProperty(GroupProperties.PROP_WAIT_SECONDS_BEFORE_JOIN, "1");

and this reduces start time of 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);

The most time is spent at SocketConnector (0.5s), TcpIpConnectionManager (2.5s) and ClusterService (2s) and elsewhere.

I would like to have both startup times down to lower than 3. Is this possible somehow?

If not, can I somehow startup the node, with only loading the data from DB and joining the cluster afterwards?

Upvotes: 3

Views: 1132

Answers (1)

Karussell
Karussell

Reputation: 17375

My current solution probably makes the most sense: separating hazelcast service from my own service and using the native Java client. With this startup is lower than 2sec.

Upvotes: 2

Related Questions