【发布时间】:2018-06-04 06:04:16
【问题描述】:
背景
谁能提供一些关于 Jenkins master 在容量规划方面的确切职责的见解。
我目前设置了一个主从设备,其中主设备是功能要弱得多的 EC2 t2.micro,但从设备是 t2.medium。
master 时不时会死掉,并且会出现与内存不足错误相关的错误,并且在签出项目时无法分配内存。 Jenkins 已经配置了-Xmx768m。
我已经验证构建是绑定到从节点而不是主节点。主服务器配置了 0 个执行程序,作业显示为在从属服务器上运行(1 个执行程序)。
示例错误
这就是一个例子
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/xyz.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:825)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1092)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1123)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:262)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags --progress https://github.com/xyz.git +refs/pull/16/head:refs/remotes/origin/PR-16 +refs/heads/develop:refs/remotes/origin/develop" returned status code 128:
stdout:
stderr: error: cannot fork() for fetch-pack: Cannot allocate memory
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1990)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1709)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:400)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:823)
... 8 more
我的问题
从资源利用的角度来看,主服务器在此设置中的作用是什么?我会假设它是检查项目和建筑的奴隶(而不是主人)。 - 这就是为什么我在内存、CPU、磁盘容量和 IOPS 方面为从站分配更多资源的原因。
除了集中式插件配置之外,除了通过 SSH 在从属设备上启动代理之外,我没想到主服务器会发挥太多作用(从内存/CPU 的角度来看,我并不认为这是一项密集的工作)。
不过,在短期内,我计划将主服务器升级到更强大的 EC2 实例类型 - 最好了解更多有关主服务器真正需要的信息,以确保我正确规划容量而不是不必要地预置太多太多了。
【问题讨论】:
标签: jenkins jenkins-slave