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

jobcacher LocalStorage can be very inefficient with slaves

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • jobcacher-plugin
    • None

      Using the jobcacher plugin I can cache my node_modules which consists of 22648 files and total 357M. This cache will restore in about ~11 seconds when the job executes on the master. However if the job executes on a slave, it will take anywhere between 1m23s when it is the only job running up to 4m to restore the cache when multiple jobs are running. 

      This is not a network issue as the same copy using scriptler and FilePath.copyRecursiveTo to the slave takes about 23 seconds.

       

      I cloned the project and commented out the IsModifiedGlob.scan method which adds a visitor to only copy new or modified files. Using this version I can get it down to 23s which is probably as fast as it can be using the jenkins channel api and it is very acceptable.

       

      I'm not sure what is the best solution to fix this as it this highly dependent on the cache content (number and size of files) and also which storage implementation is used. Maybe we could add a hint property which could be used to influence how the cache is treated and would simply be ignored if the provider does not know what to do with it.

      e.g.:

      • LocalStorage:
        • hint 'newOrModified': Current behaviour,
        • hint 'bulkCopy': Copy all files in bulk

      Thanks,

            repolevedavaj Jonas Bamberger
            dcendents Daniel Beland
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: