我使用 java -jar jenkins.war 和 java -jar slave.jar 来运行 Jenkins master 和 slave。我想知道 Jenkins 调用了多少个 JVM,我可以配置它们的参数。
在大师中:
- 我认为只有一个 JVM(我不在 master 中运行作业)
在奴隶中:
- java -jar slave.jar => 一个 JVM
- 每个作业都有一个新的 JVM,这个 JVM 运行预构建步骤、获取源代码(SVN、GIT 等)、后构建步骤
- 每个 Maven 都有自己的 JVM 每个 Junit 都有自己的 JVM
另一个问题是,我可以在管理节点的高级部分设置slave的JVM,但是谁使用它的配置?
最佳答案
每个 Maven 构建都不会在其自己的 JVM 中运行。 Java是多线程的。当您启动从站时,您可以配置它可以处理的线程数,主站也是如此。
通常您在从属节点上运行构建。在 unix 系统上,这些可以设置为从远程节点上的主服务器自动运行。
Manage Jenkins -> Manage Nodes -> New Node
在启动高级选项下,您可以为运行 Jenkins 节点软件的远程 JVM 指定 JVM 参数。
每个选项都有帮助,例如“#executors”选项:
This controls the number of concurrent builds that Jenkins can perform. So the value affects the overall system load Jenkins may incur. A good value to start with would be the number of processors on your system.
Increasing this value beyond that would cause each build to take longer, but it could increase the overall throughput, because it allows CPU to build one project while another build is waiting for I/O.
When using Jenkins in the master/slave mode, setting this value to 0 would prevent the master from doing any building on its own. Slaves may not have zero executors, but may be temporarily disabled using the button on the slave's status page.
关于jenkins - Jenkins 调用了多少个 JVM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19718406/