[Richfaces-exadel] Fwd: [seam-dev] Some profiling of blockingthreads
Jay Balunas
tech4j at gmail.com
Thu Oct 2 09:52:33 EDT 2008
forgot to cc seam-dev :-)
On Thu, Oct 2, 2008 at 9:51 AM, Jay Balunas <tech4j at gmail.com> wrote:
>
>
> On Wed, Oct 1, 2008 at 8:12 PM, Dan Allen <dan.j.allen at gmail.com> wrote:
>
>> Jay,
>>
>> This is great work and very interesting to follow.
>
> thanks
>
>>
>>
>> I would like to make a suggestion regarding the tests. Putting the
>> wiki under test is extremely valuable because it is a complex
>> application and therefore reflective of our users' applications.
>> However, it is tricky for others to follow along, because as you
>> mentioned, it is not trivial to setup. To supplement those tests,
>> perhaps you can generate a seam-gen application with a test schema
>> (perhaps stealing from one of the example application) so that we can
>> compare numbers with yours. What makes a seam-gen application valuable
>> to test is that it uses the Seam Application Framework, which is a
>> well known performance bottleneck in Seam because of its excessive use
>> of getInstance() and joinTransaction().
>
>
> I think you are correct for the reasons you state and others. The wiki
> example also does not use EJBs which I suspect a large number of seam apps
> do. I was planning on looking at the dvdstore next and that uses several
> technologies (EJB, JBPM, etc...).
>
> However I could look at a seam-gen EAR project as well, but I would like to
> get some other opinions on this. I do not think that I will have enough
> time to do both.
>
>
>>
>> It shouldn't take too long to generate the seam-gen application and
>> reverse engineer the schema. The tedious part is generating a whole
>> bunch of fake data, but emacs or vi should make quick work of that.
>
>
> Yeah - the fake data is tricky, but there are some tools that can do this
> for us.
>
>
>>
>>
>> -Dan
>>
>> On Wed, Oct 1, 2008 at 6:02 PM, Jay Balunas <tech4j at gmail.com> wrote:
>> > The example I was using was the seam wiki example, but that is not a
>> trivial
>> > thing to set up. I have not tried the same profiling on the other seam
>> > examples so I am not 100% sure that they will show the same behavior,
>> > although I would think that they would.
>> >
>> > As for the profiler report - what are you looking for exactly?
>> Basically
>> > under load (25 users) I noticed threads blocking on the
>> > ViewHandlerWrapper.fillChain method. The details are below.
>> >
>> > Regards,
>> > Jay
>> >
>> > On Wed, Oct 1, 2008 at 5:56 PM, Alexandr Smirnov <asmirnov at exadel.com>
>> > wrote:
>> >>
>> >> Jay, can you send me profiler report or a reference application ?
>> >>
>> >> Jay Balunas wrote:
>> >> > I was able to update and build with RichFaces 3.3.0-SNAPSHOT and saw
>> >> > your changes.
>> >> >
>> >> > The good news is that I no longer see any blocking threads in the
>> >> > "org.ajax4jsf.application.
>> >> > AjaxViewHandler" - none at all which is great.
>> >> >
>> >> > The bad news is that the performance has not increased in any
>> >> > meaningful or repeatable way.
>> >> >
>> >> > During my profiling I noticed a definite increase in the blocked
>> >> > threads performing JNDI lookups. My theory is that the
>> >> > AjaxViewHandler was acting as a gate and effectively slowing down
>> >> > concurrent requests into Seam proper. These threads now fly straight
>> >> > through and into Seam processing. They the end up blocked with the
>> >> > other threads performing the lookups.
>> >> >
>> >> > I will continue to look at the lookup issues, and let you all know
>> >> > what I find.
>> >> >
>> >> > -Jay
>> >> >
>> >> >
>> >> > On Tue, Sep 30, 2008 at 2:05 PM, Jay Balunas <jbalunas at redhat.com
>> >> > <mailto:jbalunas at redhat.com>> wrote:
>> >> >
>> >> > Excellent - I will build from sources and test the changes.
>> >> >
>> >> > I'll post the findings up on seam-dev.
>> >> >
>> >> > -Jay
>> >> > ----- "Nick Belaevski" <nbelaevski at exadel.com
>> >> > <mailto:nbelaevski at exadel.com>> wrote:
>> >> >
>> >> > > All,
>> >> > >
>> >> > > I've created JIRA issue for this optimization:
>> >> > > https://jira.jboss.org/jira/browse/RF-4554 and have just fixed
>> it.
>> >> > >
>> >> > > As from now ViewHandlerWrapper#fillChain method is not
>> >> > synchronized
>> >> > > anymore.
>> >> > >
>> >> > > Best regards,
>> >> > > Nick Belaevski
>> >> > >
>> >> > > > -----Original Message-----
>> >> > > > From: richfaces-exadel-bounces at redhat.com
>> >> > <mailto:richfaces-exadel-bounces at redhat.com>
>> >> > [mailto:richfaces-exadel- <mailto:richfaces-exadel->
>> >> > > > bounces at redhat.com <mailto:bounces at redhat.com>] On Behalf Of
>> >> > Max Rydahl Andersen
>> >> > > > Sent: Tuesday, September 30, 2008 10:32 AM
>> >> > > > To: Jay Balunas; richfaces-exadel at redhat.com
>> >> > <mailto:richfaces-exadel at redhat.com>
>> >> > > > Subject: Re: [Richfaces-exadel] Fwd: [seam-dev] Some
>> profiling
>> >> > of
>> >> > > > blockingthreads
>> >> > > >
>> >> > > > Sergey/Nik ? Any news on this one ?
>> >> > > >
>> >> > > > /max
>> >> > > >
>> >> > > > > Hi Guys,
>> >> > > > >
>> >> > > > > I have been doing some performance testing on seam
>> >> > applications
>> >> > > and have
>> >> > > > > been able to post some of the results. One of the areas
>> that
>> >> > I
>> >> > > have
>> >> > > > > investigated so far was blocking/waiting threads.
>> >> > > > >
>> >> > > > > In my example I am running 25 concurrent users and hitting
>> the
>> >> > > seam wiki
>> >> > > > > example. I am seeing blocked threads waiting on
>> >> > > > > "org.ajax4jsf.application.AjaxViewHandler".
>> >> > > > > I have investigated it a bit (see below), and have included
>> >> > some
>> >> > > of the
>> >> > > > > discussions on the seam-dev list.
>> >> > > > >
>> >> > > > > I would like to get an opinion of the synchronized
>> fillChain
>> >> > > method, and
>> >> > > > > see
>> >> > > > > if there is another way to handle this.
>> >> > > > >
>> >> > > > > Thoughts?
>> >> > > > >
>> >> > > > > Thanks,
>> >> > > > > Jay
>> >> > > > >
>> >> > > > > ---------- Forwarded message ----------
>> >> > > > > From: Emmanuel Bernard <emmanuel at hibernate.org
>> >> > <mailto:emmanuel at hibernate.org>>
>> >> > > > > Date: Thu, Sep 25, 2008 at 10:01 AM
>> >> > > > > Subject: Re: [seam-dev] Some profiling of blocking threads
>> >> > > > > To: Jay Balunas <tech4j at gmail.com <mailto:tech4j at gmail.com
>> >>
>> >> > > > > Cc: Pete Muir <pmuir at redhat.com <mailto:pmuir at redhat.com
>> >>,
>> >> > "seam-dev at lists.jboss.org <mailto:seam-dev at lists.jboss.org>" <
>> >> > > > > seam-dev at lists.jboss.org <mailto:seam-dev at lists.jboss.org
>> >>
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > > On Sep 25, 2008, at 09:17, Jay Balunas wrote:
>> >> > > > >
>> >> > > > > org.ajax4jsf.application.AjaxViewHandler
>> >> > > > >> --------------------------------------------
>> >> > > > >> - This was not a large % of the blocked threads but
>> caught
>> >> > my
>> >> > > eye as a
>> >> > > > >> potential trouble spot because it seemed directly related
>> to
>> >> > > ajax
>> >> > > > calls.
>> >> > > > >> - This was easier to track down and the root cause is in
>> the
>> >> > > > >> org.ajax4jsf.application.ViewHandlerWrapper class.
>> >> > > > >> - see
>> >> > > > >>
>> >> > > >
>> >> > >
>> >> >
>> >> >
>> http://anonsvn.jboss.org/repos/richfaces/trunk/framework/api/src/main/java
>> >> > > > /org/ajax4jsf/application/ViewHandlerWrapper.java
>> >> > > > >> - The problem is all the calls to "fillChain" which is a
>> >> > > synchronized
>> >> > > > >> method in the class.
>> >> > > > >> - We need to find out how often the "_initialized" field
>> is
>> >> > > false - is
>> >> > > > >> this once a request, once for each component, etc...
>> >> > > > >> - it appears to be called many times - I will look
>> further
>> >> > into
>> >> > > this.
>> >> > > > >>
>> >> > > > >>
>> >> > > > > I will raise this the richfaces dev guys, and see what can
>> be
>> >> > > done.
>> >> > > > >
>> >> > > > >
>> >> > > > > Using the double check lock pattern with a volatile should
>> >> > make
>> >> > > things
>> >> > > > > better. It has to be done right though :)
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > >
>> >> > > >
>> >> > > >
>> >> > > > --
>> >> > > > /max
>> >> > > >
>> >> > > > _______________________________________________
>> >> > > > Richfaces-exadel mailing list
>> >> > > > Richfaces-exadel at redhat.com <mailto:
>> Richfaces-exadel at redhat.com>
>> >> > > > https://www.redhat.com/mailman/listinfo/richfaces-exadel
>> >> > >
>> >> > > _______________________________________________
>> >> > > Richfaces-exadel mailing list
>> >> > > Richfaces-exadel at redhat.com <mailto:
>> Richfaces-exadel at redhat.com>
>> >> > > https://www.redhat.com/mailman/listinfo/richfaces-exadel
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > blog: http://in.relation.to/Bloggers/Jay
>> >> >
>> ------------------------------------------------------------------------
>> >> >
>> >> > _______________________________________________
>> >> > Richfaces-exadel mailing list
>> >> > Richfaces-exadel at redhat.com
>> >> > https://www.redhat.com/mailman/listinfo/richfaces-exadel
>> >>
>> >
>> >
>> >
>> > --
>> > blog: http://in.relation.to/Bloggers/Jay
>> >
>> > _______________________________________________
>> > Richfaces-exadel mailing list
>> > Richfaces-exadel at redhat.com
>> > https://www.redhat.com/mailman/listinfo/richfaces-exadel
>> >
>>
>>
>>
>> --
>> Dan Allen
>> Software consultant | Author of Seam in Action
>>
>> http://mojavelinux.com
>> http://mojavelinux.com/seaminaction
>>
>> NOTE: While I make a strong effort to keep up with my email on a daily
>> basis, personal or other work matters can sometimes keep me away
>> from my email. If you contact me, but don't hear back for more than a
>> week,
>> it is very likely that I am excessively backlogged or the message was
>> caught in the spam filters. Please don't hesitate to resend a message if
>> you feel that it did not reach my attention.
>>
>
>
>
> --
> blog: http://in.relation.to/Bloggers/Jay
>
--
blog: http://in.relation.to/Bloggers/Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/seam-dev/attachments/20081002/78998ddf/attachment.html
More information about the seam-dev
mailing list