[appengine-java] Re: Possible to cause instance recycling?

2010-02-27 Thread Ian Marshall
I am developing a web app for GAE/J using the Wicket framework, and I
too find that my application instances often do not survive one minute
before being cycled out (I am the sole source of traffic). One effect
of this, within the app start-up delay, is that this takes out my
singleton PersistenceManagerFactory instance, so I have to recreate a
new one for many interactions with my app.


  CODE SNIPPETS
  -
  private static volatile PersistenceManagerFactory g_pmf = null;

  // Called before every data exchange with the datastore
  public static PersistenceManagerFactory
getPersistenceManagerFactory()
  {
if (g_pmf == null)
  synchronized (DataExchange.class)// Non-GAE class
  {
if (g_pmf == null)
{
  loadProperties();// Non-GAE method
  g_pmf =
JDOHelper.getPersistenceManagerFactory(g_sDatabaseMode);
}
  }

return g_pmf;
  }

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Possible to cause instance recycling?

2010-02-26 Thread Jake
Hey Ikai,

Nope, not deliberately trying to force a cycle.  I'm just trying to
figure out if it's my fault for the continued aggressive recycling.
Some people complain about losing the instance after an hour, but I'm
losing it after 5 seconds.

I'm certainly aware that a new deployment causes an instance restart -
I should hope so!  That's not what is happening here.

You suggest being able to crash the instance - is there something I
might be doing to cause that in the cloud?  Again, I'm not seeing any
exceptions or errors in my log file and all works fine in local-mode
and on a different version in Tomcat.

I'm certainly willing to share any/all source code to help debug this
problem.  We're experimenting with GAE, but we'll need something that
stays up under load for demonstrations in Q2.

Thanks!

Jake

On Feb 26, 1:41 pm, Ikai L (Google) ika...@google.com wrote:
 Are you trying to force it to cycle? A deploy will do that, but there's a
 limit to the number of deploys you can do a day. Beyond that, the only way
 to unintentionally cause it to cycle would be to crash the instance, I
 suppose. It doesn't sound like that is what is happening here.



 On Thu, Feb 25, 2010 at 2:11 PM, Jake jbrooko...@cast.org wrote:
  Hey all,

  I know that instance recycling times are not ideal - that's not my
  problem here.  I'm wondering if it is possible to unintentionally
  cause GAE to drop your instance and restart it?

  I'm using the Wicket framework.  Everything works locally, but when I
  deployed today, I experienced 5 instance restarts in the span of three
  minutes - each restart is 15-20 seconds.

  I'm not seeing any exceptions in the logs.  My quotas, load, etc are
  all fine (practically non-existent).  Application behavior is perfect
  - just with delays.

  The only strenuous thing I'm doing is loading/processing a 350K XML
  document into a Java object when the instance starts.

  AppID:  http://jacob-brookover.appspot.com

  Look at the Library and Start Reading the first two pages of Call of
  the Wild.

  This project is a port of an existing project that has gone through
  pretty rigorous testing, usage.

  Thanks!

  Jake

  --
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post to this group, send email to
  google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.

 --
 Ikai Lan
 Developer Programs Engineer, Google App 
 Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.