【问题标题】:Extremely slow transaction commit on multi-node Hazelcast cluster多节点 Hazelcast 集群上的事务提交极慢
【发布时间】:2021-12-12 12:12:18
【问题描述】:

使用 2 节点 hazelcast 服务器随机提交 hazelcast 时,我们遇到了极其缓慢的提交。我们有 XA 事务管理器与数据库和 hazelcast 参与同一事务,并注意到 hazelcast 随机提交但通常需要 5 秒。它在重负载时更常发生,但在低负载时也可能发生。

我们无法在一个节点 hazelcast 服务器上重现该问题。

看起来当需要 TWO_PHASE 提交时在 hazelcast 节点之间复制事务日志可能需要很长时间......但 5 秒似乎真的很长。

我们正在使用 Hazelcast 4.2.2

我们的 hazelcast 服务器设置是:

        properties.setProperty("hazelcast.event.thread.count", "48");
        properties.setProperty("hazelcast.query.predicate.parallel.evaluation", "true");
        properties.setProperty("hazelcast.operation.responsequeue.idlestrategy", "backoff");
        properties.setProperty("hazelcast.aggregation.accumulation.parallel.evaluation", "false");

        properties.setProperty("hazelcast.operation.thread.count", "48");
        properties.setProperty("hazelcast.operation.call.timeout.millis", "30000");
        properties.setProperty("hazelcast.slow.operation.detector.enabled", "true");
        properties.setProperty("hazelcast.slow.operation.detector.stacktrace.logging.enabled", "true");
        properties.setProperty("hazelcast.slow.operation.detector.log.purge.interval.seconds", "60000");
        properties.setProperty("hazelcast.slow.operation.detector.log.retention.seconds", "60000");
        properties.setProperty("hazelcast.slow.operation.detector.threshold.millis", "100");

        properties.setProperty("hazelcast.clientengine.thread.count", "48");
        properties.setProperty("hazelcast.clientengine.query.thread.count", "48");
     

        properties.setProperty("hazelcast.diagnostics.enabled", String.valueOf(performanceLogEnabled));
        properties.setProperty("hazelcast.diagnostics.metric.level", "info");
        properties.setProperty("hazelcast.diagnostics.invocation.sample.period.seconds", "30");
        properties.setProperty("hazelcast.diagnostics.pending.invocations.period.seconds", "30");
        properties.setProperty("hazelcast.diagnostics.slowoperations.period.seconds", "30");
        properties.setProperty("hazelcast.diagnostics.overloaded.connections.period.seconds", "30");
        properties.setProperty("hazelcast.diagnostics.max.rolled.file.size.mb", "100");
        properties.setProperty("hazelcast.diagnostics.max.rolled.file.count", "3");
        properties.setProperty("hazelcast.diagnostics.storeLatency.period.seconds", "60");
        properties.setProperty("hazelcast.diagnostics.directory", "./logs/diagnostics");

【问题讨论】:

    标签: transactions hazelcast distributed-transactions


    【解决方案1】:

    我的假设是,这是因为在单节点设置中从一个节点复制到另一个节点,您不会注意到这个问题。

    要确认,您可能需要检查备份配置,尤其是this section。将备份计数设置为 0:如果它解决了问题,那么下一步将是制作 backup async

    请注意,在这种情况下,您会遇到一致性问题,具体取决于您所在的节点。欢迎来到分布式系统...

    【讨论】:

    • 是的,但是我们负担不起备份 0 ... 备份异步也不能保证一致性,还是我错了?我们设法通过删除设置来加快提交时间并保留大部分默认设置,但我们仍在研究导致问题的设置
    • 不幸的是,这个问题来自于分布式系统:你必须把光标放在全速、无保证的一致性和保证的一致性、尽力而为速度之间。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-10
    • 2013-04-24
    • 1970-01-01
    • 2020-12-27
    • 1970-01-01
    相关资源
    最近更新 更多