参数调整过程详情
默认WordCountTopology
- topology parallelism=1(保持默认)
- componentRam=1G(保持默认)
- containerRam=1G(保持默认)
- containerCpu=2core(保持默认)
增加Topology并行度
增加并行度1
- topology parallelism=2(默认为1,进行修改)
- componentRam=1G(保持默认)
- containerRam=1G(保持默认)
- containerCpu=2core(保持默认)
增加并行度2
- topology parallelism=4(默认为1,进行修改)
- componentRam=1G(保持默认)
- containerRam=1G(保持默认)
- containerCpu=2core(保持默认)
分析增加并行度的意义:
由于单节点内存和CPU资源的限制(这里为Ram:6G,CPU:4core),在将topology parallelism从1增加为2时,topology运行时的最大反压降低。内存和CPU使用率均有所降低。这是因为,随着topology并行度的提高,为一个component创建了多个实例运行在不同的container中,每个container在这里保持着默认的1G Ram和2 CPUcore的资源分配。在parallelism=4时,反压机制没有被触发,但由于主机中资源的限制,此时CPU和ram的使用状态已经为峰值,使得topology的运行在一段时间内,有所停止,而且对CPU和ram的占用峰值波动很大。
增加ConponentRam
增加ComponentRam:
- topology parallelism=1(保持默认)
- componentRam=2G(默认为1,进行修改)
- containerRam=1G(保持默认)
- containerCpu=2core(保持默认)
分析:相较于WordCountTopology的默认设置,在单纯的增加topology中的component的RAM资源后(这里从1G增加到2G,并行度保持1),Spout组件的Max GC情况有所改善,反压和CPU的运行情况没有明显改善。
增加ContainerRam
增加ContainerRam:
- topology parallelism=1(保持默认)
- componentRam=1G(保持默认)
- containerRam=2G(默认为1,进行修改)
- containerCpu=2core(保持默认)
分析:在保持并行度为1的情况下,单纯提高ContainerRam的值(1G提高为2G),对所有的资源使用情况均没有明显的作用。
增加Parallelism和ContainerRam
增加Parallelism和ContainerRam:
- topology parallelism=2(默认为1,进行修改)
- componentRam=1G(保持默认)
- containerRam=2G(默认为1,进行修改)
- containerCpu=2core(保持默认)
分析:相较于默认的资源设置,将parallelism提高至2,containerRam同时提高为2G,component中的Max CPU和Max Memory有所降低,bolt中的反压情况有轻微的改善。比较明显的,在bolt中的Max Capacity(最大处理能力)的异常情况明显好转。但对Max GC的异常情况没有改善。
增加Parallelism & ContainerRam & CPU
增加Parallelism和ContainerRam:
- topology parallelism=3(默认为1,进行修改)
- componentRam=1G(保持默认)
- containerRam=2G(默认为1,进行修改)
- containerCpu=4core(保持默认)