You are viewing a plain text version of this content. The canonical link for it is here.
Posted to builds@apache.org by Jesse Glick <je...@oracle.com> on 2010/09/21 17:52:38 UTC

Saving job configuration still extremely slow

I had thought this was just a problem with the old Hudson installation, but it is still true: clicking "Save" from a job's /configure screen takes several minutes before 
the job's main page is loaded again. This should only take a second or two. Maybe someone can trace what is taking so long?

Re: Saving job configuration still extremely slow

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Wed, Sep 22, 2010 at 11:59 PM, Antoine Toulme <an...@toulme.name> wrote:
> Can you share with us the bug number once you filed it ?

http://issues.hudson-ci.org/browse/HUDSON-7535

/niklas

Re: Saving job configuration still extremely slow

Posted by Antoine Toulme <an...@toulme.name>.
Can you share with us the bug number once you filed it ?

On Wed, Sep 22, 2010 at 00:19, Niklas Gustavsson <ni...@protocol7.com>wrote:

> On Wed, Sep 22, 2010 at 12:07 AM, Jesse Glick <je...@oracle.com>
> wrote:
> > On 09/21/2010 04:37 PM, Niklas Gustavsson wrote:
> >>
> >> If anyone got any idea, besides asking the Hudson devs to optimize
> >> this code
> >
> > Sounds like a clear bug in Hudson; will you file it?
>
> Yes, that's my plan.
>
> /niklas
>

Re: Saving job configuration still extremely slow

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Wed, Sep 22, 2010 at 12:07 AM, Jesse Glick <je...@oracle.com> wrote:
> On 09/21/2010 04:37 PM, Niklas Gustavsson wrote:
>>
>> If anyone got any idea, besides asking the Hudson devs to optimize
>> this code
>
> Sounds like a clear bug in Hudson; will you file it?

Yes, that's my plan.

/niklas

Re: Saving job configuration still extremely slow

Posted by Jesse Glick <je...@oracle.com>.
On 09/21/2010 04:37 PM, Niklas Gustavsson wrote:
> If anyone got any idea, besides asking the Hudson devs to optimize
> this code

Sounds like a clear bug in Hudson; will you file it?

Re: Saving job configuration still extremely slow

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Tue, Sep 21, 2010 at 10:41 PM, Ted Dunning <te...@gmail.com> wrote:
> Ouch.  It sounds like the easiest optimization would be to not do this
> computation if the dependencies for the current job have not changed.

Right, in the current code, as far as I understand it, the dependency
graph is rebuilt twice, no matter what changes was done to the
configuration.

/niklas

Re: Saving job configuration still extremely slow

Posted by Ted Dunning <te...@gmail.com>.
Ouch.  It sounds like the easiest optimization would be to not do this
computation if the dependencies for the current job have not changed.

That would be easier than doing the correct thing which would be to
propagate simply changes until the system reaches something unchanged.

On Tue, Sep 21, 2010 at 1:37 PM, Niklas Gustavsson <ni...@protocol7.com>wrote:

> On Tue, Sep 21, 2010 at 9:44 PM, Niklas Gustavsson <ni...@protocol7.com>
> wrote:
> > On Tue, Sep 21, 2010 at 5:52 PM, Jesse Glick <je...@oracle.com>
> wrote:
> >> I had thought this was just a problem with the old Hudson installation,
> but
> >> it is still true: clicking "Save" from a job's /configure screen takes
> >> several minutes before the job's main page is loaded again. This should
> only
> >> take a second or two. Maybe someone can trace what is taking so long?
> >
> > It's on my todo list, but I haven't yet looked into it.
>
> Thread dumping a few job configuration saves, the all sit on this
> stacktrace (even non-Maven builds):
>
> "Handling POST /hudson/job/Ant_JDK_1.4/configSubmit : http-8090-40"
> daemon prio=10 tid=0x0000000041940800 nid=0x46a4 runnable
> [0x00007f2fa6721000]
>   java.lang.Thread.State: RUNNABLE
>        at java.lang.String.intern(Native Method)
>        at hudson.maven.ModuleDependency.<init>(ModuleDependency.java:48)
>        at hudson.maven.ModuleDependency.<init>(ModuleDependency.java:54)
>        at hudson.maven.MavenModule.asDependency(MavenModule.java:296)
>        at
> hudson.maven.MavenModule.buildDependencyGraph(MavenModule.java:385)
>        at
> hudson.maven.MavenModuleSet.buildDependencyGraph(MavenModuleSet.java:487)
>        at hudson.model.DependencyGraph.<init>(DependencyGraph.java:100)
>        at hudson.model.Hudson.rebuildDependencyGraph(Hudson.java:3346)
>        at
> hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:588)
>        at sun.reflect.GeneratedMethodAccessor1225.invoke(Unknown Source)
> ...
>
>
> Looking into the code, what this does is that the last thing Hudson do
> on saving a job configuration is to recalculate the dependency graph
> between all jobs. The DependencyGraph code warns that this is slow,
> looks like it will loop over all jobs which in turn will loop over all
> jobs... And in our pretty large environment, this adds up pretty fast.
> If anyone got any idea, besides asking the Hudson devs to optimize
> this code, feel free to speak up :-)
>
> /niklas
>

Re: Saving job configuration still extremely slow

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Tue, Sep 21, 2010 at 9:44 PM, Niklas Gustavsson <ni...@protocol7.com> wrote:
> On Tue, Sep 21, 2010 at 5:52 PM, Jesse Glick <je...@oracle.com> wrote:
>> I had thought this was just a problem with the old Hudson installation, but
>> it is still true: clicking "Save" from a job's /configure screen takes
>> several minutes before the job's main page is loaded again. This should only
>> take a second or two. Maybe someone can trace what is taking so long?
>
> It's on my todo list, but I haven't yet looked into it.

Thread dumping a few job configuration saves, the all sit on this
stacktrace (even non-Maven builds):

"Handling POST /hudson/job/Ant_JDK_1.4/configSubmit : http-8090-40"
daemon prio=10 tid=0x0000000041940800 nid=0x46a4 runnable
[0x00007f2fa6721000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.String.intern(Native Method)
	at hudson.maven.ModuleDependency.<init>(ModuleDependency.java:48)
	at hudson.maven.ModuleDependency.<init>(ModuleDependency.java:54)
	at hudson.maven.MavenModule.asDependency(MavenModule.java:296)
	at hudson.maven.MavenModule.buildDependencyGraph(MavenModule.java:385)
	at hudson.maven.MavenModuleSet.buildDependencyGraph(MavenModuleSet.java:487)
	at hudson.model.DependencyGraph.<init>(DependencyGraph.java:100)
	at hudson.model.Hudson.rebuildDependencyGraph(Hudson.java:3346)
	at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:588)
	at sun.reflect.GeneratedMethodAccessor1225.invoke(Unknown Source)
...


Looking into the code, what this does is that the last thing Hudson do
on saving a job configuration is to recalculate the dependency graph
between all jobs. The DependencyGraph code warns that this is slow,
looks like it will loop over all jobs which in turn will loop over all
jobs... And in our pretty large environment, this adds up pretty fast.
If anyone got any idea, besides asking the Hudson devs to optimize
this code, feel free to speak up :-)

/niklas

Re: Saving job configuration still extremely slow

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Tue, Sep 21, 2010 at 5:52 PM, Jesse Glick <je...@oracle.com> wrote:
> I had thought this was just a problem with the old Hudson installation, but
> it is still true: clicking "Save" from a job's /configure screen takes
> several minutes before the job's main page is loaded again. This should only
> take a second or two. Maybe someone can trace what is taking so long?

It's on my todo list, but I haven't yet looked into it.

/niklas