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

Jenkins.getUser(...) is debilitatingly slow with a large number of users

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None
    • 1.554.1 with JENKINS-22822

      We've got 1026 users on builds.apache.org, and when you try to view a user or go through a user's views, etc, load time is abominable most of the time - ~54 seconds or so in the example below. While we're seeing a lot of what might be i/o related slowness in other areas, this seems kind of insane. Does User.getAll() really need to reload every user's config.xml every 10 seconds?

          [JENKINS-23281] Jenkins.getUser(...) is debilitatingly slow with a large number of users

          Andrew Bayer added a comment -

          And something is messed up on that volume, apparently - stat i/o and the like is really nasty on it in general, based on tests from outside Jenkins. So this may not be as bad as it seemed.

          Andrew Bayer added a comment - And something is messed up on that volume, apparently - stat i/o and the like is really nasty on it in general, based on tests from outside Jenkins. So this may not be as bad as it seemed.

          Oleg Nenashev added a comment -

          Does User.getAll() really need to reload every user's config.xml every 10 seconds?

          No idea why Jenkins performs such loading, but it's a legacy behavior, hence we cannot just remove it.
          I propose to add a switch variable, which will make Jenkins to load users on the startup only.

          Oleg Nenashev added a comment - Does User.getAll() really need to reload every user's config.xml every 10 seconds? No idea why Jenkins performs such loading, but it's a legacy behavior, hence we cannot just remove it. I propose to add a switch variable, which will make Jenkins to load users on the startup only.

          Oleg Nenashev added a comment -

          In addition, User.getAll() seems to be unsafe against multiple caller threads.

          Oleg Nenashev added a comment - In addition, User.getAll() seems to be unsafe against multiple caller threads.

          Daniel Beck added a comment -

          abayer: Was this issue caused by your disk being complete crap?

          Daniel Beck added a comment - abayer: Was this issue caused by your disk being complete crap?

          Andrew Bayer added a comment -

          Yeah, but I'd say some work should be done regardless - the complete crapness of the disk exposed the problem, but there's still some brutal inefficiencies.

          Andrew Bayer added a comment - Yeah, but I'd say some work should be done regardless - the complete crapness of the disk exposed the problem, but there's still some brutal inefficiencies.

          Oleg Nenashev added a comment -

          I'd guess that JENKINS-47429 solves this issue. It has been released in 2.89.3.

          abayer please confirm

          Oleg Nenashev added a comment - I'd guess that JENKINS-47429 solves this issue. It has been released in 2.89.3. abayer please confirm

          Baptiste Mathus added a comment - - edited

          At least the style used between Andrew and svanoort seems to confirm this is the same issue:
          "debilitatingly slow" and "Absolutely atrocious performance" look like perfect duplicates to me .

          Baptiste Mathus added a comment - - edited At least the style used between Andrew and svanoort seems to confirm this is the same issue: "debilitatingly slow" and "Absolutely atrocious performance" look like perfect duplicates to me .

          Sam Van Oort added a comment -

          The user caching behavior has been tweaked a couple times a couple different ways, so I think the variant here can either be closed as no longer applicable or a dupe (doing it now). 

          Sam Van Oort added a comment - The user caching behavior has been tweaked a couple times a couple different ways, so I think the variant here can either be closed as no longer applicable or a dupe (doing it now). 

          Andrew Bayer added a comment -

          Yeah, sounds fine to me.

          Andrew Bayer added a comment - Yeah, sounds fine to me.

          Sam Van Oort added a comment - - edited

          batmat Other choice phrasings "user lookup is slower than molasses in winter" and "I like to watch paint dry while fetching changelog entries for a large branch."

          Sam Van Oort added a comment - - edited batmat  Other choice phrasings "user lookup is slower than molasses in winter" and "I like to watch paint dry while fetching changelog entries for a large branch."

            Unassigned Unassigned
            abayer Andrew Bayer
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: