Put in Hazelcast Multimap lasts > 5sec on 2 node cluster
i discovered a strange performance leak in one statement of our application, which runs on a two node cluster currently. It is this very method:
private void开发者_JS百科 addIdToMember( final long id, final Member executedMember )
{
this.entityIdToMemberHostname.put( id, executedMember.getInetSocketAddress( ).getHostName( ) );
}
The entityIdToMemberHostname map is initialized (once) as follows:
this.entityIdToMemberHostname = Hazelcast.getMultiMap( "entityIdToMemberHostname" );
Uncommenting the call to the addIdToMember method descreases the execution time of the surrounding method 5 seconds (it now takes only 20ms at all).
Is a put to a Hazelcast multimap that expensive in a cluster?
Solution was not to get the hostname but the IP to identify the member; hostname resolution was the problem.
精彩评论