Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38640

Unstash painfully slow for large artifacts (due to compression?)

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • workflow-api-plugin

    Description

      When sending a stash across the network, the data transfer can be significantly slower than the underlying network. This seems to be due to some slow on-the-fly compression happening during the transfer. Using the following script, the Unstash phase takes 1-2 seconds for 10MB of /dev/zero, and 49 seconds for 10MB of /dev/urandom. The Stash phase consistently takes 1-2 seconds. This makes me think there's a compression step, since /dev/zero should compress much faster than /dev/urandom.

      node {
          deleteDir()
          stage "Stash"
          sh "dd if=/dev/zero of=data bs=1M count=10"
          stash name: 'build_outputs', includes: 'data'
          sh "date"
          node('lab') {
              deleteDir()
              stage "Unstash"
              unstash 'build_outputs'
              sh "ls -al"
          }
      }
      

      This looks similar to JENKINS-36914, in particular this comment:
      https://issues.jenkins-ci.org/browse/JENKINS-36914?focusedCommentId=268472&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-268472

      I'm not calling this a dupe of that because the original text refers to stash only, and this bug seems isolated to unstash. Also this is on x86, not ARM.

      Attachments

        Issue Links

          Activity

            jkoleszar John Koleszar added a comment -

            The admonition not to use stash is too strong, in my opinion. I can see plenty of situations where having a repository manager or setting up shared storage are completely unnecessary complexity. The latest release of this plugin performs as I'd expect.

            jkoleszar John Koleszar added a comment - The admonition not to use stash is too strong, in my opinion. I can see plenty of situations where having a repository manager or setting up shared storage are completely unnecessary complexity. The latest release of this plugin performs as I'd expect.
            oleg_nenashev Oleg Nenashev added a comment -

            There is NO official recommendation to avoid stash/unstash. I've just mentioned it as a possible workaround

            oleg_nenashev Oleg Nenashev added a comment - There is NO official recommendation to avoid stash/unstash. I've just mentioned it as a possible workaround
            jkoleszar John Koleszar added a comment -

            Thanks, Oleg. This is the documentation I was referring to about stash only being suitable for small files:
            https://github.com/jenkinsci/workflow-basic-steps-plugin/commit/413df48bdcb832261e8fb110150eeb8069e77c33

            Maybe there's an upper limit where it falls over, but I haven't hit it yet. In my opinion, if there were one, it'd be a bug worth fixing, rather than something to document away as WAI.

            jkoleszar John Koleszar added a comment - Thanks, Oleg. This is the documentation I was referring to about stash only being suitable for small files: https://github.com/jenkinsci/workflow-basic-steps-plugin/commit/413df48bdcb832261e8fb110150eeb8069e77c33 Maybe there's an upper limit where it falls over, but I haven't hit it yet. In my opinion, if there were one, it'd be a bug worth fixing, rather than something to document away as WAI.
            oleg_nenashev Oleg Nenashev added a comment -

            The fix has been backported to 2.19.3

            oleg_nenashev Oleg Nenashev added a comment - The fix has been backported to 2.19.3

            This ticket is quite old but in the past lots of changes have happened and I wonder what the current network usage with stashing is. Did the Jenkins guys improve stashing?

            My background is that the CI builds various C++ testsuites and I would like to split up building and testing. That's where stashing would be useful if the performance of copying the involved files would be acceptable. In the past this has been really bad - with or without compression enabled.

            Any current experiences?

            I'm talking about folders to be copied with e.g. 500MB.

            heiko_nardmann Heiko Nardmann added a comment - This ticket is quite old but in the past lots of changes have happened and I wonder what the current network usage with stashing is. Did the Jenkins guys improve stashing? My background is that the CI builds various C++ testsuites and I would like to split up building and testing. That's where stashing would be useful if the performance of copying the involved files would be acceptable. In the past this has been really bad - with or without compression enabled. Any current experiences? I'm talking about folders to be copied with e.g. 500MB.

            People

              andresrc Andres Rodriguez
              jkoleszar John Koleszar
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: