提交 8a3e909d 编写于 作者: K Kohsuke Kawaguchi

[FIXED JENKINS-7813]

Fixed the throughput problem between master/slave communication.
This fix contains two independent problems.

One was in the remoting. During a large sustained data transfer
(such as artifact archiving and large test reports), the way we
were doing flow control and ACK-ing were penalizing us badly.
I improved the flow control algorithm in remoting 1.23, and also
increased advertised window size so that the transfer can saturate
available bandwidth even when a latency is large. (And unless
the reader side is excessivesly slow, this shouldn't increase
any memory consumption.)

The other fix was in trilead-ssh2, which is our SSH client
implementation used by ssh-slaves plugin. The buffer size for flow
control was too small. I improved the way buffering is done to reduce
the memory footprint when the reader closely follows the writer, then I
increased the advertised window size. Again, this shouldn't increase
memory consumption (in fact it'll likely actually reduce them) unless
the reader end gets abandoned.

On my simulated latency-injected network, the sustained transfer rate is
now on par with scp. We win for smaller files because of the TCP slow
start penality that scp would incur, and we lose a bit as files get
larger due to additional framing overhead.

If you have manually extracted slave.jar and placed them on slaves, you
need to update them to 2.23 to see the performance benefits.
上级 c49d6b5b
......@@ -64,6 +64,9 @@ Upcoming changes</a>
<li class=bug>
Master node mode not correctly displayed in <code>/computer/(master)/configure</code>.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17263">issue 17263</a>)
<li class='major rfe'>
Performance improvement in master/slave communication throughput
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-7813">issue 7813</a>)
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -125,7 +125,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>trilead-ssh2</artifactId>
<version>build214-jenkins-1</version>
<version>build214-jenkins-2</version>
</dependency>
<dependency>
<groupId>org.kohsuke.stapler</groupId>
......
......@@ -32,6 +32,7 @@ import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.Result;
import hudson.util.FormValidation;
import hudson.util.TimeUnit2;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.AncestorInPath;
......@@ -122,6 +123,7 @@ public class ArtifactArchiver extends Recorder {
File dir = build.getArtifactsDir();
dir.mkdirs();
final long start = System.nanoTime();
listener.getLogger().println(Messages.ArtifactArchiver_ARCHIVING_ARTIFACTS());
try {
FilePath ws = build.getWorkspace();
......@@ -157,6 +159,8 @@ public class ArtifactArchiver extends Recorder {
return true;
}
// System.out.println("Took "+ TimeUnit2.NANOSECONDS.toMillis(System.nanoTime()-start));
return true;
}
......
......@@ -175,7 +175,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>remoting</artifactId>
<version>2.22</version>
<version>2.23</version>
</dependency>
<dependency>
......
......@@ -271,7 +271,19 @@ THE SOFTWARE.
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-slaves</artifactId>
<!-- when upgrading may need to add credentials and ssh-credentials too: https://github.com/jenkinsci/ssh-slaves-plugin/commit/7f7031bdaae528baf8e4a1cf29a95849ef268c5c -->
<version>0.22</version>
<version>0.23</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1.3.1</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<version>0.2</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册