I found that one of the inefficiencies is around using RemoteInputStream when launching Maven on a slave.

When a channel is built to a Maven on slave, it'll look like this:

Master                         slave                               Maven
========================================================================
Channel                                                          Channel
+- RemoteInputStream --> SocketInputStream --> <-- SocketOutputStream -+

So each time master's Channel reads something, it would have to wait for a full roundtrip between master and slave. This is very bad if the slave is trying to send large amount of data over channel.

I used a simple Callble from the master to Maven that returns 16MB of data with this latency-induced network, and verified that it took whopping 15mins.

A better way to do this is to have the slave pump SocketInputStream and feed data into master, then have the master buffer it.

Master                         slave                                      Maven
===============================================================================

Channel                                                          
+- FastPipedInputStream                        pump thread
   +- FastPipedOutputStream <-- RemoteOutputStream | SocketInputStream -> ...

This hides latency better. With this change, the artificial 16MB callable completes in just 11secs.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to