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

Java applications have degraded performance on Windows Server 2008+ agents when started via Task Scheduler

      Technically this is not a Jenkins problem.

      But I think, this problem can potentially affect many users, so it would be nice to have it in documentation or at least as known issue here.

      So we have windows agents connected to server via JNLP. To make agents connect to server after each restart / revert, I created a task in Windows scheduler to kick a bat, which starts agent.jar
      The problem is, that Windows scheduler in Windows 2016 starts all the tasks in "below normal" priority.
      So java process, executing agent.jar is run in "below normal" priority too.
      And when we run our Java application on agent via Jenkins job or script, the application's process starts in "below normal" priority as well. Which increase execution time roughly twice, comparing to manual start on the same agent. Even when I go to agent and change Java application priority manually to "high" right after it is started, that does not help.

      There is no "priority" option when windows scheduler creates tasks, but you can fix it by exporting task to XML, editing its "Priority" tag and importing it back (after deleting original task of course).
      After setting priority to "normal" this way execution time returns to normal.

          [JENKINS-64861] Java applications have degraded performance on Windows Server 2008+ agents when started via Task Scheduler

          Alexandr Panshin created issue -
          Alexandr Panshin made changes -
          Description Original: Technically this is not a Jenkins problem.

          But I think, this problem can potentially affect many users, so it would be nice to have it in documentation or at least as known issue here.

          So we have windows agents connected to server via JNLP. To make agents connect to server after each restart / revert, I created a task in Windows scheduler to kick a bat, which starts agent.jar
          The problem is, that Windows scheduler start all the tasks in "below normal" priority.
          So java process, executing agent.jar is run in "below normal" priority too.
          And when we run our Java application on agent via Jenkins job or script, the application's process starts in "below normal" priority as well. Even when I got to agent and change priority manually
          New: Technically this is not a Jenkins problem.

          But I think, this problem can potentially affect many users, so it would be nice to have it in documentation or at least as known issue here.

          So we have windows agents connected to server via JNLP. To make agents connect to server after each restart / revert, I created a task in Windows scheduler to kick a bat, which starts agent.jar
          The problem is, that Windows scheduler in Windows 2016 starts all the tasks in "below normal" priority.
          So java process, executing agent.jar is run in "below normal" priority too.
          And when we run our Java application on agent via Jenkins job or script, the application's process starts in "below normal" priority as well. Which increase execution time roughly twice. Even when I go to agent and change Java application priority manually to "high" right after it is started, that does not help.

          There is no "priority" option when windows scheduler creates tasks, but you can fix it by exporting task to XML, editing its "Priority" tag and importing it back (after deleting original task of course)
          Labels New: JNLP jnlp-slave windows
          Alexandr Panshin made changes -
          Description Original: Technically this is not a Jenkins problem.

          But I think, this problem can potentially affect many users, so it would be nice to have it in documentation or at least as known issue here.

          So we have windows agents connected to server via JNLP. To make agents connect to server after each restart / revert, I created a task in Windows scheduler to kick a bat, which starts agent.jar
          The problem is, that Windows scheduler in Windows 2016 starts all the tasks in "below normal" priority.
          So java process, executing agent.jar is run in "below normal" priority too.
          And when we run our Java application on agent via Jenkins job or script, the application's process starts in "below normal" priority as well. Which increase execution time roughly twice. Even when I go to agent and change Java application priority manually to "high" right after it is started, that does not help.

          There is no "priority" option when windows scheduler creates tasks, but you can fix it by exporting task to XML, editing its "Priority" tag and importing it back (after deleting original task of course)
          New: Technically this is not a Jenkins problem.

          But I think, this problem can potentially affect many users, so it would be nice to have it in documentation or at least as known issue here.

          So we have windows agents connected to server via JNLP. To make agents connect to server after each restart / revert, I created a task in Windows scheduler to kick a bat, which starts agent.jar
          The problem is, that Windows scheduler in Windows 2016 starts all the tasks in "below normal" priority.
          So java process, executing agent.jar is run in "below normal" priority too.
          And when we run our Java application on agent via Jenkins job or script, the application's process starts in "below normal" priority as well. Which increase execution time roughly twice, comparing to manual start on the same agent. Even when I go to agent and change Java application priority manually to "high" right after it is started, that does not help.

          There is no "priority" option when windows scheduler creates tasks, but you can fix it by exporting task to XML, editing its "Priority" tag and importing it back (after deleting original task of course).
          After setting priority to "normal" this way execution time returns to normal.
          Alexandr Panshin made changes -
          Attachment New: JenkinsAgent.xml [ 53995 ]
          Oleg Nenashev made changes -
          Labels Original: JNLP jnlp-slave windows New: JNLP jnlp-slave performance windows
          Helder Magalhães made changes -
          Issue Type Original: Bug [ 1 ] New: Task [ 3 ]
          Helder Magalhães made changes -
          Labels Original: JNLP jnlp-slave performance windows New: JNLP jnlp-slave performance task-scheduler windows
          Helder Magalhães made changes -
          Labels Original: JNLP jnlp-slave performance task-scheduler windows New: JNLP documentation jnlp-slave performance task-scheduler windows
          Helder Magalhães made changes -
          Summary Original: Java applications have degraded performance on Windows agents, connected via JNLP New: Java applications have degraded performance on Windows 2016+ agents when started via Task Scheduler

          Just stumbled on this "issue" (unexpected behavior).

           

          Technically this is not a Jenkins problem.

          Agreed, I'm proposing a reshape of the issue into a documentation task in the hope that it is featured in a KB article or a FAQ entry.

           Although the description is sufficient, I'm leaving a couple tightly related references:

          1. Windows Task Scheduler: changing task-priority
          2. Windows system performance is slow because _mprosrv processes are paging

          Helder Magalhães added a comment - Just stumbled on this "issue" (unexpected behavior).   Technically this is not a Jenkins problem. Agreed, I'm proposing a reshape of the issue into a documentation task in the hope that it is featured in a KB article or a FAQ entry.  Although the description is sufficient, I'm leaving a couple tightly related references: Windows Task Scheduler: changing task-priority Windows system performance is slow because _mprosrv processes are paging

            Unassigned Unassigned
            alpanshin Alexandr Panshin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: