我怎样才能修改负载平衡行为詹金斯用来控制奴隶? [英] How can I modify the Load Balancing behavior Jenkins uses to control slaves?

查看:165
本文介绍了我怎样才能修改负载平衡行为詹金斯用来控制奴隶?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用詹金斯为我们的CI构建系统。我们也使用并发建立让詹金斯将独立建造每一个变化。这意味着我们经常有5或6建立同时运行相同的工作。为了适应这种情况,我们每个4奴有12个执行者。

We use Jenkins for our CI build system. We also use 'concurrent builds' so that Jenkins will build each change independently. This means we often have 5 or 6 builds of the same job running simultaneously. To accommodate this, we have 4 slaves each with 12 executors.

问题是,詹金斯做它的奴隶之间没有真正负载均衡。它试图巩固其previously建(presumably,以减少从源代码控制同步的时间)相同奴隶的工作。这是一个问题,因为詹金斯将建立在同一个从我们构建的所有6个实例(或更可能2从站之间)。一个构建机器被越陷越深,运行速度很慢,而他们的休息闲置。

The problem is that Jenkins doesn't really 'load balance' among its slaves. It tries to build a job on the same slave that it previously built on (presumably to reduce the time syncing from source control). This is a problem because Jenkins will build all 6 instances of our build on the same slave (or more likely between 2 slaves). One build machine gets bogged down and runs very slowly while the rest of them sit idle.

有没有改变负载平衡行为詹金斯用来控制它的奴隶?插件什么的。

Is there a plugin or something that alters the load balancing behavior Jenkins uses to control its slaves?

推荐答案

如果你没有找到一个插件,可以自动进行,是你可以做什么的想法:

If you do not find a plugin that does it automatically, here's an idea of what you can do:


  • 节点标签参数插件

  • 添加的 SLAVE 的参数,你的工作

  • 限制作业的 $ {运行SLAVE}

  • 添加触发器工作,将做到以下几点:

  • Install Node Label Parameter plugin
  • Add SLAVE parameter to your jobs
  • Restrict jobs to run on ${SLAVE}
  • Add a trigger job that will do the following:


  • 通过系统的Groovy脚本分析载荷分布,并决定在哪个节点开始下一个版本。

  • 在该节点上使用 Parametertized触发调度构建
    插件

    通过向的 SLAVE 的参数指定适当的值。

  • Analyze load distribution via a System Groovy Script and decide on which node to start next build.
  • Dispatch the build on that node with Parametertized Trigger plugin by assigning appropriate value to SLAVE parameter.

为了分析您需要安装 Groovy插件负载分配和熟悉的詹金斯主模块API 。这里有一些有用的初始指针

In order to analyze load distribution you need to install Groovy plugin and familiarize yourself with Jenkins Main Module API. Here are some useful initial pointers.

这篇关于我怎样才能修改负载平衡行为詹金斯用来控制奴隶?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆