Thanks Toby.  Your explanation makes sense and it looks like that's
exactly what's happening:

09-16 01:39PM 57.474 /test 200 4036ms 4478cpu_ms 65api_cpu_ms 0kb
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6)

      W 09-16 01:40PM 00.884

      foo.bar.TestServlet init: Initializing Test Servlet

      W 09-16 01:40PM 00.908

      foo.bar.TestServlet doGet: Before calling request.getSession()

      W 09-16 01:40PM 01.484

       foo.bar.TestServlet doGet: After calling request.getSession()



On Sep 16, 4:09 pm, Toby Reyelts <to...@google.com> wrote:
> App Engine retires and spins up new instances of your app based on demand.
> If a new instance of your app is being created, you'll see higher CPU then
> normal as all of your code gets reloaded and initialized. This sounds like
> the behavior you're seeing. One way to test that is to write a logging
> statement in your Servlet's init() method.
>
> On Wed, Sep 16, 2009 at 4:00 PM, Traveler1980 <jshar...@gmail.com> wrote:
>
> > So....no one else has noticed anything like this???
>
> > Regards,
> > Jamie
>
> > On Sep 15, 9:13 am, Traveler1980 <jshar...@gmail.com> wrote:
> > > Hi Everyone,
>
> > > I've noticed that CPU occasionally spikes when creating an
> > > HTTPSession.  It only seems to happen when it's been awhile since an
> > > app has been accessed or when an app is initially deployed.
>
> > > For example, I created a simple test servlet that creates a session
> > > and and writes a response:
>
> > > protected void doGet(HttpServletRequest req, HttpServletResponse resp)
> > > throws ServletException, IOException {
> > >    req.getSession();
> > >    PrintWriter writer = resp.getWriter();
> > >    writer.write("Test Complete");
> > >    writer.flush();
> > >    writer.close();
>
> > > }
>
> > > When I deploy the app and invoke the servlet for the first time, I see
> > > the following in the admin console:
> > > 09-15 05:57AM 29.487 /test 200 7184ms 4381cpu_ms 65api_cpu_ms 0kb
> > > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/
> > > 2009011913 Firefox/3.0.6 (.NET C
>
> > > Note the high CPU and long response time.
>
> > > Subsequent session creations are much faster.  If I delete my cookies
> > > and re-invoke the servlet, CPU is approx. 70-80ms.
>
> > > Now, if I leave the app for awhile (let's say an hour) and hit the
> > > servlet again, CPU is once again through the roof for the initial
> > > GET.
>
> > > Any thoughts about what's going on here?  I know that Google's session
> > > management involves memcache and the datastore.  Could the high CPU be
> > > a side-effect of some initialization routine, etc...?
>
> > > Thanks for the feedback,
> > > Jamie
>
>
--~--~---------~--~----~------------~-------~--~----~
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-java@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to