确认时 Storm 拓扑性能受到影响
Storm topology performance hit when acking
我正在使用雅虎的这个工具 运行 在我的风暴集群上进行一些性能测试 -
https://github.com/yahoo/storm-perf-test
我注意到当我打开 acking 时,性能几乎提高了 10 倍。以下是重现测试的一些细节 -
簇 -
3 个主管节点和 1 个 nimbus 节点。每个节点都是一个c3.large.
有 acking -
bin/storm jar storm_perf_test-1.0.0-SNAPSHOT-jar-with-dependencies.jar com.yahoo.storm.perftest.Main --ack --boltParallel 60 --maxSpoutPending 100 --messageSizeByte 100 --name some-topo --numWorkers 9 --spoutParallel 20 --testTimeSec 100 --pollFreqSec 20 --numLevels 2
status topologies totalSlots slotsUsed totalExecutors executorsWithMetrics time time-diff ms transferred throughput (MB/s)
WAITING 1 3 0 141 0 1424707134585 0 0 0.0
WAITING 1 3 3 141 141 1424707154585 20000 24660 0.11758804321289062
WAITING 1 3 3 141 141 1424707174585 20000 17320 0.08258819580078125
RUNNING 1 3 3 141 141 1424707194585 20000 13880 0.06618499755859375
RUNNING 1 3 3 141 141 1424707214585 20000 21720 0.10356903076171875
RUNNING 1 3 3 141 141 1424707234585 20000 43220 0.20608901977539062
RUNNING 1 3 3 141 141 1424707254585 20000 35520 0.16937255859375
RUNNING 1 3 3 141 141 1424707274585 20000 33820 0.16126632690429688
没有确认 -
bin/storm jar ~/target/storm_perf_test-1.0.0-SNAPSHOT-jar-with-dependencies.jar com.yahoo.storm.perftest.Main --boltParallel 60 --maxSpoutPending 100 --messageSizeByte 100 --名称 some-topo --numWorkers 9 --spoutParallel 20 --testTimeSec 100 --pollFreqSec 20 --numLevels 2
status topologies totalSlots slotsUsed totalExecutors executorsWithMetrics time time-diff ms transferred throughput (MB/s)
WAITING 1 3 0 140 0 1424707374386 0 0 0.0
WAITING 1 3 3 140 140 1424707394386 20000 565460 2.6963233947753906
WAITING 1 3 3 140 140 1424707414386 20000 1530680 7.298851013183594
RUNNING 1 3 3 140 140 1424707434386 20000 3280760 15.643882751464844
RUNNING 1 3 3 140 140 1424707454386 20000 3308000 15.773773193359375
RUNNING 1 3 3 140 140 1424707474386 20000 4367260 20.824718475341797
RUNNING 1 3 3 140 140 1424707494386 20000 4489000 21.40522003173828
RUNNING 1 3 3 140 140 1424707514386 20000 5058960 24.123001098632812
最后两列非常重要。它显示传输的元组数和速率(以 MBps 为单位)。
开启acking时,这种性能是否会受到storm的影响?我使用的是 0.9.3 版本,没有高级网络。
启用 acking 后总会有一定程度的性能下降 -- 这是您为可靠性付出的代价。禁用 acking 后吞吐量总是更高,但您无法保证您的数据是否被处理或丢弃在地板上。无论是像您所看到的那样是 10 倍的命中率还是更低,都取决于调整。
一个重要的设置是 topology.max.spout.pending
,它允许您限制 spout,以便在任何给定时间只允许 "in flight" 数量的元组。该设置有助于确保下游螺栓不会被淹没并开始使元组超时。
该设置对禁用 acking 也没有影响——这就像打开闸门并丢弃任何溢出的数据。同样,它总是会更快。
启用 acking 后,Storm 将确保所有内容至少处理一次,但您需要针对您的用例适当调整 topology.max.spout.pending
。由于每个用例都不同,因此这是一个反复试验的问题。将它设置得太低,你的吞吐量就会很低。设置得太高,你的下游螺栓会不堪重负,元组会超时,你会得到重放。
为了说明,将 maxSpoutPending
设置为 1 并再次设置 运行 基准。然后尝试 1000。
所以是的,如果不进行适当的调整,性能可能会提高 10 倍。如果您的用例可以接受数据丢失,请关闭 acking。但是,如果您需要可靠的处理,请打开它,针对您的用例进行调整,并水平扩展(添加更多节点)以满足您的吞吐量要求。
我正在使用雅虎的这个工具 运行 在我的风暴集群上进行一些性能测试 - https://github.com/yahoo/storm-perf-test
我注意到当我打开 acking 时,性能几乎提高了 10 倍。以下是重现测试的一些细节 - 簇 - 3 个主管节点和 1 个 nimbus 节点。每个节点都是一个c3.large.
有 acking -
bin/storm jar storm_perf_test-1.0.0-SNAPSHOT-jar-with-dependencies.jar com.yahoo.storm.perftest.Main --ack --boltParallel 60 --maxSpoutPending 100 --messageSizeByte 100 --name some-topo --numWorkers 9 --spoutParallel 20 --testTimeSec 100 --pollFreqSec 20 --numLevels 2
status topologies totalSlots slotsUsed totalExecutors executorsWithMetrics time time-diff ms transferred throughput (MB/s)
WAITING 1 3 0 141 0 1424707134585 0 0 0.0
WAITING 1 3 3 141 141 1424707154585 20000 24660 0.11758804321289062
WAITING 1 3 3 141 141 1424707174585 20000 17320 0.08258819580078125
RUNNING 1 3 3 141 141 1424707194585 20000 13880 0.06618499755859375
RUNNING 1 3 3 141 141 1424707214585 20000 21720 0.10356903076171875
RUNNING 1 3 3 141 141 1424707234585 20000 43220 0.20608901977539062
RUNNING 1 3 3 141 141 1424707254585 20000 35520 0.16937255859375
RUNNING 1 3 3 141 141 1424707274585 20000 33820 0.16126632690429688
没有确认 -
bin/storm jar ~/target/storm_perf_test-1.0.0-SNAPSHOT-jar-with-dependencies.jar com.yahoo.storm.perftest.Main --boltParallel 60 --maxSpoutPending 100 --messageSizeByte 100 --名称 some-topo --numWorkers 9 --spoutParallel 20 --testTimeSec 100 --pollFreqSec 20 --numLevels 2
status topologies totalSlots slotsUsed totalExecutors executorsWithMetrics time time-diff ms transferred throughput (MB/s)
WAITING 1 3 0 140 0 1424707374386 0 0 0.0
WAITING 1 3 3 140 140 1424707394386 20000 565460 2.6963233947753906
WAITING 1 3 3 140 140 1424707414386 20000 1530680 7.298851013183594
RUNNING 1 3 3 140 140 1424707434386 20000 3280760 15.643882751464844
RUNNING 1 3 3 140 140 1424707454386 20000 3308000 15.773773193359375
RUNNING 1 3 3 140 140 1424707474386 20000 4367260 20.824718475341797
RUNNING 1 3 3 140 140 1424707494386 20000 4489000 21.40522003173828
RUNNING 1 3 3 140 140 1424707514386 20000 5058960 24.123001098632812
最后两列非常重要。它显示传输的元组数和速率(以 MBps 为单位)。
开启acking时,这种性能是否会受到storm的影响?我使用的是 0.9.3 版本,没有高级网络。
启用 acking 后总会有一定程度的性能下降 -- 这是您为可靠性付出的代价。禁用 acking 后吞吐量总是更高,但您无法保证您的数据是否被处理或丢弃在地板上。无论是像您所看到的那样是 10 倍的命中率还是更低,都取决于调整。
一个重要的设置是 topology.max.spout.pending
,它允许您限制 spout,以便在任何给定时间只允许 "in flight" 数量的元组。该设置有助于确保下游螺栓不会被淹没并开始使元组超时。
该设置对禁用 acking 也没有影响——这就像打开闸门并丢弃任何溢出的数据。同样,它总是会更快。
启用 acking 后,Storm 将确保所有内容至少处理一次,但您需要针对您的用例适当调整 topology.max.spout.pending
。由于每个用例都不同,因此这是一个反复试验的问题。将它设置得太低,你的吞吐量就会很低。设置得太高,你的下游螺栓会不堪重负,元组会超时,你会得到重放。
为了说明,将 maxSpoutPending
设置为 1 并再次设置 运行 基准。然后尝试 1000。
所以是的,如果不进行适当的调整,性能可能会提高 10 倍。如果您的用例可以接受数据丢失,请关闭 acking。但是,如果您需要可靠的处理,请打开它,针对您的用例进行调整,并水平扩展(添加更多节点)以满足您的吞吐量要求。