Page 283 - 《软件学报》2021年第8期
P. 283

蒲勇霖  等:Storm 平台下的线程重分配与数据迁移节能策略                                                 2565



                 通信成本为W′    node cost  ,即
                            edge
                                               edge
                                                       edge
                               edge
                                      edge
                                                                                     edge
                                                                       edge
                             W′ node cost  =  W node cost  −  sW node cost  +  cW node cost  =  ⎛  ⎜  1−  s  +  c ⎞  ⎟  W node cost  =  ⎛  ⎜  n d ⎞  −  ⎟  W node cost  (20)
                                               n        n    ⎝   n  n ⎠      ⎝  n ⎠
                    当前节点内部线程间的通信成本为W′             executor cost  ,即
                                                   edge
                                                           edge
                                                 edge
                                        edge
                                                                           edge
                                      W′ executor cost  =  W executor cost  +  dW executor cost  =  ⎛  ⎜  m d ⎞  +  ⎟  W executor cost  (21)
                                                            m      ⎝  m ⎠
                    由于数据迁移完成后,集群内的线程不发生改变,则当前线程的计算开销为W′                          computation cost  ,即
                                                                                 executor
                                                   executor
                                                              executor
                                                 W′ computation cost  =  W computation cost          (22)
                    因此,数据迁移完成后集群的路径成本W′ 为
                                                    cost
                                                      ⎛  nd−       ⎛  m d+ ⎞  ⎞
                                      W′   W′ =  executor  +  ⎜  ⎟  W  edge  +  ⎜  ⎟  W  edge        (23)
                                            computation cost
                                       cost
                                                      ⎝  n ⎠  node cost  ⎝  m ⎠  executor cost
                    此外,由于相同工作节点内线程间的通信开销可忽略不计,即
                                                      W′ edge  =  0                                  (24)
                                                       executor cost
                    则存在:
                                                  ⎛  nd− ⎞
                                                                 edge
                                                         edge
                                                  ⎜    ⎟  W node cost  < W node cost                 (25)
                                                  ⎝  n ⎠
                    即获得式(19).                                                                         …
                    此外,根据定理 2 可知,集群内节点间的通信开销降低.由于集群内所有的线程都是通过路径相互关联的,而
                 非关键线程被重新分配,则在拓扑结构上,位于非关键线程下游所有线程(包括位于关键路径上的线程)的数据
                 都将提前到达.因此集群内所有路径的计算延迟降低,进而达到提高集群性能的目的.
                 3    节能策略分析
                    基于以上理论分析,提出 Storm 平台下的线程重分配与数据迁移节能策略,该节能策略包括资源约束算法
                 与数据迁移算法,在减少通信开销的前提下,提高了集群性能,并节约了集群的总能耗.图 5 为节能策略流程图.


















                                           Fig.5    Flowchart of energy-efficient strategy
                                                   图 5   节能策略流程图
                    该策略主要分为以下 5 个步骤.
                    步骤 1:通过负载监控器获得原系统拓扑路径以及数据传输与处理的基本信息.
                    步骤 2:根据集群内数据的传输与处理,确定工作节点的资源约束.
   278   279   280   281   282   283   284   285   286   287   288