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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • workflow-api-plugin

      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.

          [JENKINS-38640] Unstash painfully slow for large artifacts (due to compression?)

          John Koleszar created issue -
          Andres Rodriguez made changes -
          Assignee New: Andres Rodriguez [ andresrc ]
          Andres Rodriguez made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andres Rodriguez made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Andres Rodriguez made changes -
          Remote Link New: This issue links to "PR workflow-api-plugin#19 (Web Link)" [ 14913 ]

          Oleg Nenashev added a comment -

          External Workspace Manager (https://github.com/jenkinsci/external-workspace-manager-plugin/blob/master/README.md) could be a workaround. With this plugin you can share the entire workspace on filer instead of stashing particular files and getting overhead on the Jenkins side.

          Oleg Nenashev added a comment - External Workspace Manager ( https://github.com/jenkinsci/external-workspace-manager-plugin/blob/master/README.md ) could be a workaround. With this plugin you can share the entire workspace on filer instead of stashing particular files and getting overhead on the Jenkins side.
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-36914 [ JENKINS-36914 ]
          Jesse Glick made changes -
          Component/s New: workflow-api-plugin [ 21711 ]
          Component/s Original: pipeline [ 21692 ]
          Jesse Glick made changes -
          Labels Original: gzip stash tar New: gzip performance stash tar
          Jesse Glick made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

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

              Created:
              Updated:
              Resolved: