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

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: core
    • Labels:
      None
    • Environment:
      red hat 5, jenkins 1.514
    • Similar Issues:

      Description

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

        Attachments

          Issue Links

            Activity

            Hide
            jacob_robertson Jacob Robertson added a comment -

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

            Show
            jacob_robertson Jacob Robertson added a comment - Moving to "core" component. I do not think this is related to the view-job-filters component.
            Hide
            rotwang 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?

            Show
            rotwang 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?
            Hide
            rotwang 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.

            Show
            rotwang 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.
            Hide
            marcinjasinski 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

            Show
            marcinjasinski 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
            Hide
            danielbeck Daniel Beck added a comment -

            Appears to be duplicate of JENKINS-18364

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

              People

              • Assignee:
                Unassigned
                Reporter:
                rotwang Bartlomiej Palmowski
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: