I found one thing that was slowing down creating entity manager factory. I was not specifying the persistent classes in persistence.xml so the persistence framework (jpa) code was loading all the classes in my jar. I listed my persistent classes and now the entity manager creation is now usually less than 4 seconds.
Len On Sep 14, 2:04 pm, lent <[email protected]> wrote: > Don, I have sent you my application id through email (by doing reply > to author). > > A few of things I should mention: > 1) we're using JPA > 2) we are not creating EMF by doing: > Persistence.createEntityManagerFactory("transactions-optional"); > instead it is created through spring's LocalEntityManagerFactoryBean > (which we subclass to ensure only one instance ofentitymanagerfactory) > > The EMF initialization is done during spring intialization so it is in > the servlet initialization path and not request processing path. It > is just that if GAE chooses to start a new application instance to > service a request, then the application startup (servlet > initialization) occurs during request processing. > > Len > > On Sep 14, 10:37 am, Don Schwarz <[email protected]> wrote: > > > > > Len, what is your application ID? > > > On Mon, Sep 14, 2009 at 12:33 PM, Larry Cable <[email protected]> wrote: > > > > can you move the EMF creation out of the request path into the > > > initialization path (Servlet.init(ServletConfig) or a static > > > initializer > > > in the Servlet class at startup ... > > > > BTW I also am using Spring IoC to create and inject the JDO EMF > > > and I dont think I am seeing the same performance issues? > > > > Do you see similar startup costs on the local dev server as well as > > > production? > > > > good luck > > > > - Larry > > > > On Sep 13, 5:27 pm, lent <[email protected]> wrote: > > > > I have been doing some profiling on application startup and it seems > > > > that there is a large amount of overhead: > > > > - it takes about 5 seconds between the time the request is received to > > > > where our spring initialization code is invoked > > > > - creating anentitymanagerfactoryis taking on average 8+ seconds > > > > Sometimes these numbers can be much bigger than this, for example we > > > > have seen creatingentitymanagerfactoryas much as 14 seconds. > > > > > Given that the application needs to its own initialization (which we > > > > are trying to minimize), we find that the application initialization > > > > becomes very long and when the server is busy and the above number are > > > > even higher, the application initialization fails to complete in 30 > > > > seconds. Note that this is just the application initialization part > > > > and then the actual request has to be processed which will take some > > > > amount of time. > > > > > Given that applications can be started on any given request, it makes > > > > things difficult with application startup time and request processing > > > > time with the 30 second limit. > > > > > Len > > > > > On Sep 8, 10:04 am, lent <[email protected]> wrote: > > > > > > Hello, > > > > > > We have an application which uses GWT (using GWT RPC) on the client > > > > > side. When the application is left idle for a while (~15 minutes) and > > > > > the application sends a request, we get this reported on the client > > > > > side: > > > > > > "The server encountered an error and could not complete your request. > > > > > If the problem persists, please report your problem and mention this > > > > > error message and the query that caused it." > > > > > > In the log, the following is logged: > > > > > > "Request was aborted after waiting too long to attempt to service your > > > > > request. Most likely, this indicates that you have reached your > > > > > simultaneous active request limit. This is almost always due to > > > > > excessively high latency in your app. Please seehttp:// > > > code.google.com/appengine/docs/quotas.htmlformore details." > > > > > > I believe that our application has been swapped out and and when the > > > > > request comes in the application is being loaded again as we see some > > > > > log entries we make when the application (servlet) gets initialized. > > > > > It does take some time to get the application initialized but the > > > > > error is reported way before 30 seconds has elapsed. Is there any way > > > > > to avoid this problem? > > > > > > Len- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---
