Re: Cayenne performance degrades over time

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jun 22 2005 - 15:57:05 EDT

  • Next message: Alan Guo: "Re: Error during Configuration initialization -- running on Websphere"

    When I say multi user, I mean some sort of server application (usually a
    web app) that has more than one user accessing it. The point is that while
    an application can run for months without a restart, each individual user
    interacts with such application within a limited period of time (a
    lifespan of a session). So each user (same as session) should be assigned
    her own instance of DataConext. Both examples that you mentioned can do
    this, so for the purpose of these discussion they are the same.

    Andrus

    > Andrus, when you say "multi user app", are you assuming a DataContext
    > created like this?:
    >
    > // assume this exists
    > HttpSession session;
    > DataContext context =
    > BasicServletConfiguration.getDefaultContext(session);
    >
    > or this?:
    >
    > DataContext context = DataContext.getThreadDataContext();
    >
    > I'm just making sure I'm understanding you correctly.
    >
    > Thanks!
    >
    > Jonathan
    >
    >
    >>>> andru..bjectstyle.org 2005-06-22 2:13:07 PM >>>
    > Paul,
    >
    > Cache settings have effect on the shared cache in a multiuser app. For
    > a
    > single session DataContext (or rather its ObjectStore) has no upper
    > limit
    > on the number of cached objects as it is designed to have a shorter
    > life
    > span.
    >
    > So a more realistic performance test would actually discard a
    > DataContext
    > and create a new one after a few operations (how many is "few" depends
    > on
    > your expected usage patterns).
    >
    > FYI: Here is the stack structure (default is level 2):
    > http://objectstyle.org/cayenne/userguide/design/caching.html
    >
    > Andrus
    >
    >
    >> Hi Andrus,
    >>
    >> I'm seeing behaviour in my app using Cayenne, where it runs slower
    > and
    >> slower
    >> the longer the application runs without a restart. I suspect that it
    > will
    >> eventually run out of memory. Upon restart, performance starts out
    > high
    >> again.
    >>
    >> I wrote a very simple test application to rule out any of my custom
    > code.
    >> It
    >> simply registers a new objects with the DataContext, sets a property,
    > and
    >> calls commitChanges. The test app prints out the elapsed time for
    > every
    >> 1000
    >> iterations. The results are here:
    >>
    >> http://www.buzzsurf.com/java/cayenne/results.txt
    >>
    >> If you want to run the simple test application yourself, it's here:
    >>
    >> http://www.buzzsurf.com/java/cayenne/CayennePerfTest.zip
    >>
    >> As you can see, performance degrades linearly over time. It seems
    > like
    >> DataContext is caching a pointer to every object created, despite my
    > cache
    >> settings?? I've been playing with the "Max Number of Objects"
    > setting in
    >> the
    >> Modeler, but different settings seem to have no effect.
    >>
    >> -Paul
    >>
    >>
    >>
    >
    >
    > ______________________________________________________________________
    > This email has been scanned by the MessageLabs Email Security System.
    > For more information please visit http://www.messagelabs.com/email
    > ______________________________________________________________________
    >
    > ______________________________________________________________________
    > This email and any files transmitted with it are confidential and
    > intended solely for the use of the individual or entity to whom they
    > are addressed. If you have received this email in error please notify
    > the system manager.
    >
    > Katun Corporation -- www.katun.com
    > _____________________________________________________________________
    >



    This archive was generated by hypermail 2.0.0 : Wed Jun 22 2005 - 15:57:06 EDT