简体   繁体   English

jenkins svn插件还原操作比命令行作业慢?

[英]jenkins svn plugin revert action slower than command line job?

I have three build machines with Jenkins v1.473 installed. 我有三台安装了Jenkins v1.473的构建机。

Let's call them machine A, B and C. All are running Windows 7 x64. 我们称它们为机器A,B和C。它们都运行Windows 7 x64。 Machine B and C jenkins installation was carried over from machine A. I simply copied the folder over and everything was imported and works fine. B机和C机的jenkins安装是从A机进行的。我只是将文件夹复制了过来,一切都已导入并且可以正常工作。

We initially had a Windows command line job that would call svn revert and then, svn update on a bunch of folders. 我们最初有一个Windows命令行作业,该作业将调用svn revert,然后对一堆文件夹进行svn更新。 After that, we would build our project. 之后,我们将构建我们的项目。 The average running time was about 10 mins. 平均运行时间约为10分钟。 SVN version of the command line tools is 1.7 on all 3 machines (with tortoisesvn) 命令行工具的SVN版本在所有3台计算机上均为1.7(带有tortoisesvn)

Since we were using command line svn commands, we didn't have access to $CHANGES when sending the job completion email, so we switched to the Jenkins svn plugin. 由于我们使用的是命令行svn命令,因此在发送作业完成电子邮件时我们无权访问$ CHANGES,因此我们切换到了Jenkins svn插件。 The switch was made on machine B and C first and after confirming it was working fine, we applied the same changes to machine A. The plugin version is 1.50. 首先在机器B和C上进行了切换,确认切换正常后,我们对机器A进行了相同的更改。插件版本为1.50。

Check-out Strategy is set to " Use 'svn update' as much as possible, with 'svn revert' before update ". 检出策略设置为“ 在更新前尽可能使用'svn更新','svn恢复' ”。 Repository browser is set to Auto. 存储库浏览器设置为“自动”。

Under Jenkins->Configuration, Subversion Workspace Version is set to 1.7. 在Jenkins->配置下,Subversion工作区版本设置为1.7。 The other fields are left as-is ( Exclusion revprop name is empty, Validate repository URLs up to the first variable name is unchecked, Update default Subversion credentials cache after successful authentication is checked) 其他字段保持原样( 排除revprop名称为空,未选中第一个变量名称之前的验证存储库URL,检查成功身份验证后更新默认Subversion凭据缓存

Now, onto my issue. 现在,到我的问题。

The running time on machine B and C stayed about the same: about 10 mins. 机器B和C的运行时间大致相同:约10分钟。

However, on machine A, running time has more than doubled: it now averages 25 mins. 但是,在机器A上,运行时间增加了一倍以上:现在平均为25分钟。 Looking at the job log, the revert part seems to be the culprit. 查看作业日志,还原部分似乎是罪魁祸首。

Is there a reason switching from svn command line to the plugin would make it run slower ? 从svn命令行切换到插件会导致它运行速度变慢吗? On top of that, on one particular machine only ? 最重要的是, 仅在一台特定机器上

After digging and testing several jobs across all machines, here's what I found out: 在所有机器上挖掘并测试了几个作业之后,我发现了以下内容:

  • command line tools are fairly faster than their plugin counterpart, most likely due to the speed of the programs themselves (compiled C binary vs SVNKIT which is written in Java and running on top of a JVM) 命令行工具比其插件要快得多,这很可能是由于程序本身的速度所致(编译后的C二进制与SVNKIT用Java编写并在JVM之上运行)
  • machine A is also fairly slower than B and C, despite having similar specs, most likely because of other applications and services running at the same time (B and C are near-fresh installs, while A has been running for a longer time, with more applications installed etc) 尽管具有相似的规格,但机器A也比B和C慢得多,这很可能是因为其他应用程序和服务同时运行(B和C是近乎全新的安装,而A已经运行了较长时间,安装了更多应用程序等)

In the end, I just split the clean/revert part from the update: 最后,我只是从更新中拆分了干净/还原部分:

  • Clean/Revert job is carried in command line (I/O heavy due to folder traversal I believe) so it is as fast as it can be 清理/还原作业是在命令行中进行的(我相信由于文件夹的遍历,I / O太重了),因此它要尽可能快
  • Update (and update only, no revert done within the plugin) is then done with the plugin (fairly fast, less than a minute usually for several dozen files) which allows me to still have access to the CHANGES variable. 然后使用该插件进行更新(并且仅更新,该插件内不执行任何还原操作)(相当快,对于几十个文件,通常不到一分钟),这使我仍然可以访问CHANGES变量。

With this, I somehow managed to keep the building time on machine A nearly unchanged (around 10 mins). 这样,我设法以某种方式使机器A上的构建时间几乎保持不变(大约10分钟)。 Machines B and C however, have seen their building times greatly improved (from 10 mins to 5 mins in general) 但是,机器B和C的构建时间大大缩短了(通常从10分钟缩短到5分钟)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM