In general, and as the numbers that you've shared also back up, spinning up
a new instance of a Java application does take more resources, both CPU and
time, than starting up a new Python application. We are making back-end
improvements in the next couple of releases to improve these  times,
particularly those whose imported libraries/frameworks consistently cause
them to time out on first startup.

If you build an application that is hit excessively, particularly if you
have an application with a fairly consistent rate of traffic, then you
shouldn't have to worry about this too much since your instances will likely
stay consistently "warm" and not spin down. Thus, you'll see far more
"cheap" Java requests than "very expensive" since instances aren't likely to
be spun down between requests.

- Jason

On Fri, Oct 16, 2009 at 6:45 AM, Toby <[email protected]> wrote:

>
> That is an interesting thread.  I was asking myself the same question.
> My problem is, that I have some expensive initialization that is done
> when the webapp is initialized.  I recognized that the very first
> request (after a longer time of idle) takes a lot of time. And as you
> say is expensive.
> I wonder if it would make sense to have a cron job that runs every
> minute to prevent this?
>
>
> On Oct 15, 10:52 pm, Timwillhack <[email protected]> wrote:
> > I should probably point out that when I say 'Timed out' I really mean,
> > clean start after waiting say 10 minutes to refresh a page, its not a
> > 30 second endless while loop or anything, its actually just outputting
> > one character from a string array.
> >
> > On Oct 15, 2:46 pm, Timwillhack <[email protected]> wrote:
> >
> > > I was just curious if the initialization of the Java VM is actually
> > > charged a client?  Here are some sample headers from Java vs. Python
> > > after letting the server timeout:
> >
> > > VERY EXPENSIVE JAVA (timed out - guessing restarting VM):
> > > X-AppEngine-Estimated-CPM-US-Dollars: $0.149171
> > > X-AppEngine-Resource-Usage: ms=4152 cpu_ms=6440 api_cpu_ms=0
> >
> > > X-AppEngine-Estimated-CPM-US-Dollars: $0.145377
> > > X-AppEngine-Resource-Usage: ms=3890 cpu_ms=6276 api_cpu_ms=0
> >
> > > Cheap JAVA (quick refresh):
> > > X-AppEngine-Estimated-CPM-US-Dollars: $0.000168
> > > X-AppEngine-Resource-Usage: ms=41 cpu_ms=3 api_cpu_ms=0
> >
> > > X-AppEngine-Estimated-CPM-US-Dollars: $0.000189
> > > X-AppEngine-Resource-Usage: ms=19 cpu_ms=4 api_cpu_ms=0
> >
> > > CHEAP PYTHON FRESH START (waited about 10 mins before connecting):
> > > X-AppEngine-Estimated-CPM-US-Dollars: $0.002778
> > > X-AppEngine-Resource-Usage: ms=103 cpu_ms=116 api_cpu_ms=0
> >
> > > X-AppEngine-Estimated-CPM-US-Dollars: $0.002778
> > > X-AppEngine-Resource-Usage: ms=106 cpu_ms=116 api_cpu_ms=0
> >
> > > PYTHON RECONNECT QUICKLY:
> > > X-AppEngine-Estimated-CPM-US-Dollars: $0.000231
> > > X-AppEngine-Resource-Usage: ms=7 cpu_ms=6 api_cpu_ms=0
> >
> > > Python is reporting very very very cheaper pricing per 1000.  Is this
> > > the case or does google not really charge for the initialization for
> > > java?  I sat here refreshing a page with a friend doing the same, out
> > > of the 40 or so requests about 4 were skyrocketed in price.  This
> > > makes me very wary about making something that is hit excessively,
> > > since it seems like each instance is only taking 10 requests each per
> > > minute or whatver....
> >
> > > Yuck, are my numbers flawed or something?  Or is Python just so much
> > > more efficient to use on 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to