• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Jenkins 1.532 + backports to stable
      Windows Server 2008 R2

      I'm getting cpu stuck at 100% when a lot of executor threads are updating permalinks

          [JENKINS-20534] Pegged CPU by writeSymlink calls

          Vincent Latombe created issue -
          Vincent Latombe made changes -
          Attachment New: JENKINS-20534_threaddump.txt [ 24656 ]

          Vincent Latombe added a comment - - edited

          A significant number of threads seem to take time during rename of the cache file. Corresponding disk queues don't seem stressed at all, it only has a CPU impact.

          java.lang.Thread.State: RUNNABLE
          	at java.io.WinNTFileSystem.rename0(Native Method)
          	at java.io.Win32FileSystem.rename(Win32FileSystem.java:535)
          	at java.io.File.renameTo(File.java:1391)
          	at jenkins.model.PeepholePermalink.writeSymlink(PeepholePermalink.java:185)
          	at jenkins.model.PeepholePermalink.updateCache(PeepholePermalink.java:142)
          	at jenkins.model.PeepholePermalink$RunListenerImpl.onCompleted(PeepholePermalink.java:219)
          	at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
          	at hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:574)
          

          Vincent Latombe added a comment - - edited A significant number of threads seem to take time during rename of the cache file. Corresponding disk queues don't seem stressed at all, it only has a CPU impact. java.lang. Thread .State: RUNNABLE at java.io.WinNTFileSystem.rename0(Native Method) at java.io.Win32FileSystem.rename(Win32FileSystem.java:535) at java.io.File.renameTo(File.java:1391) at jenkins.model.PeepholePermalink.writeSymlink(PeepholePermalink.java:185) at jenkins.model.PeepholePermalink.updateCache(PeepholePermalink.java:142) at jenkins.model.PeepholePermalink$RunListenerImpl.onCompleted(PeepholePermalink.java:219) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) at hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:574)
          Vincent Latombe made changes -
          Environment Original: Jenkins 1.532 + backports to stable
          New: Jenkins 1.532 + backports to stable
          Windows Server 2008 R2
          Jesse Glick made changes -
          Labels New: performance
          Jesse Glick made changes -

          PR to avoid renaming of symlinks
          https://github.com/jenkinsci/jenkins/pull/1057

          Vincent Latombe added a comment - PR to avoid renaming of symlinks https://github.com/jenkinsci/jenkins/pull/1057
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Assignee New: Vincent Latombe [ vlatombe ]

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/jenkins/model/PeepholePermalink.java
          http://jenkins-ci.org/commit/jenkins/c0742b8bff9fe407e568da7ed860f30d9ea8aedc
          Log:
          JENKINS-20534 Avoid usage of temporary file to write symlink.

          Creating a symlink is an atomic operation, and additionally
          usage of tmp file + rename performs very badly on NTFS file
          system because of the way the rename is tracked in the $MFT.

          In case symbolic links are not supported, we still fallback to
          a regular file.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/jenkins/model/PeepholePermalink.java http://jenkins-ci.org/commit/jenkins/c0742b8bff9fe407e568da7ed860f30d9ea8aedc Log: JENKINS-20534 Avoid usage of temporary file to write symlink. Creating a symlink is an atomic operation, and additionally usage of tmp file + rename performs very badly on NTFS file system because of the way the rename is tracked in the $MFT. In case symbolic links are not supported, we still fallback to a regular file.

            vlatombe Vincent Latombe
            vlatombe Vincent Latombe
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: