放入 Hazelcast Multimap 持续 > 2 节点集群上 5 秒
我在我们的应用程序的一个语句中发现了一个奇怪的性能泄漏,该应用程序当前在两个节点集群上运行。正是这个方法:
private void addIdToMember( final long id, final Member executedMember )
{
this.entityIdToMemberHostname.put( id, executedMember.getInetSocketAddress( ).getHostName( ) );
}
entityIdToMemberHostname 映射按如下方式初始化(一次):
this.entityIdToMemberHostname = Hazelcast.getMultiMap( "entityIdToMemberHostname" );
取消对 addIdToMember 方法的调用的注释会将周围方法的执行时间减少 5 秒(现在只需要 20 毫秒)。
在集群中,对 Hazelcast 多重映射的 put 是否昂贵?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案不是获取主机名,而是获取 IP 来识别成员;主机名解析是问题所在。
Solution was not to get the hostname but the IP to identify the member; hostname resolution was the problem.