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

jobs load slowly while url contains "/view/" string

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None
    • red hat 5, jenkins 1.514

      jobs load slowly while url contains "/view/" string, if "/view/" is removed from url job loads many times faster

          [JENKINS-19671] jobs load slowly while url contains "/view/" string

          Moving to "core" component. I do not think this is related to the view-job-filters component.

          Jacob Robertson added a comment - Moving to "core" component. I do not think this is related to the view-job-filters component.

          Bartlomiej Palmowski added a comment - - edited

          So I've created reverse proxy with rewrite on nginx and simply configured it like

          location / {
          proxy_pass http://my_jenkins_server;
          [...]
          rewrite ^/view/[^/]/job/([^/]/)$ /job/$1 last;
          }

          and now it is lightning fast, any idea what is happening?

          Bartlomiej Palmowski added a comment - - edited So I've created reverse proxy with rewrite on nginx and simply configured it like location / { proxy_pass http://my_jenkins_server ; [...] rewrite ^/view/ [^/] /job/( [^/] /)$ /job/$1 last; } and now it is lightning fast, any idea what is happening?

          I've also noticed that load time of a specific job is significantly slower if you refer to it via heavily populated view. So if your view has fewer jobs the single job will load much faster.

          Bartlomiej Palmowski added a comment - I've also noticed that load time of a specific job is significantly slower if you refer to it via heavily populated view. So if your view has fewer jobs the single job will load much faster.

          Hi,
          this comment describes performance issue related to many downstream/upstream projects, nested views and a large number of jobs.

          The jenkins environment includes:

          • 1200 jobs,
          • sectioned view "TRUNK_VIEW" containing 16 sections,
          • a job "exampe_job" has 118 downstream projects,
          • sectioned view plug-in,
          • rule strategy plug-in.

          When an "example_job" starts to create a view "jenkins/view/TRUNK_VIEW/job/example_job"
          it creates links for every downstream and upstream projects:
          "jenkins/view/TRUNK_VIEW/job/downstram_project".
          When a link for downstream_project with "TRUNK_VIEW" view is created following steps are performed:
          1) Method hudson.Functions.getRelativeLinkTo. This method checks if a view contains a downstream project and creates a link.
          2) Method hudson.plugins.sectioned_view.SectionedView.getItems -> hudson.plugins.sectioned_view.SectionedViewSection.getItems
          This method gets all items for every view section.
          3) jenkins.model.Jenkins.getItems - gets all items
          4) hudson.model.AbstractItem.hasPermission
          Check permission for every item.

          In this case unfortunately, the last step is repeated 2265600 times and consumes a lot of memory and processor time. This happens because 118 * 16 * 1200 = 2265600 (donwstream projects * sections * all jobs). Besides, a rule strategy plug-in creates a few objects which is not an issue for 1 item but it is an issue for 2265600 items.

          BR,
          Marcin

          Marcin Jasinski added a comment - Hi, this comment describes performance issue related to many downstream/upstream projects, nested views and a large number of jobs. The jenkins environment includes: 1200 jobs, sectioned view "TRUNK_VIEW" containing 16 sections, a job "exampe_job" has 118 downstream projects, sectioned view plug-in, rule strategy plug-in. When an "example_job" starts to create a view "jenkins/view/TRUNK_VIEW/job/example_job" it creates links for every downstream and upstream projects: "jenkins/view/TRUNK_VIEW/job/downstram_project". When a link for downstream_project with "TRUNK_VIEW" view is created following steps are performed: 1) Method hudson.Functions.getRelativeLinkTo. This method checks if a view contains a downstream project and creates a link. 2) Method hudson.plugins.sectioned_view.SectionedView.getItems -> hudson.plugins.sectioned_view.SectionedViewSection.getItems This method gets all items for every view section. 3) jenkins.model.Jenkins.getItems - gets all items 4) hudson.model.AbstractItem.hasPermission Check permission for every item. In this case unfortunately, the last step is repeated 2265600 times and consumes a lot of memory and processor time. This happens because 118 * 16 * 1200 = 2265600 (donwstream projects * sections * all jobs). Besides, a rule strategy plug-in creates a few objects which is not an issue for 1 item but it is an issue for 2265600 items. BR, Marcin

          Daniel Beck added a comment -

          Appears to be duplicate of JENKINS-18364

          Daniel Beck added a comment - Appears to be duplicate of JENKINS-18364

            Unassigned Unassigned
            rotwang Bartlomiej Palmowski
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: