Tip:
Highlight text to annotate it
X
MALE SPEAKER: Startup times for App Engine Java are pretty
high for my application, around 30 seconds.
That is actually pretty high.
And Java Apps, in general, even with reserved instances
that we feel are underutilized, we're still
getting warm up requests.
Any advice?
FEMALE SPEAKER: Yeah, so I think, again, this is going to
be something that is going to be covered quite extensively
in Google I/O. We have a talk, Matt Stephenson actually is
going to be giving a talk on autoscalling Java.
So that talk is likely to cover much of that.
And Matt Stephenson also, with one of our other guys from
Cloud Solution, Wally Yau, he wrote an article that was
published on, again, the App Engine's Developers
Documentation site for managing optimization of
starting up spring applications.
And often we find that the spring applications really
take a longer time to start.
There's a lot of libraries involved.
There is a lot of scanning of classes and such that goes on
automatically with spring when it starts up.
And that can lead to quite long load times.
I think, as I suspect, this is probably likely
to be a spring issue.
At the same time I mean it's also the possibility that
you're loading libraries that you may not need immediately.
And you may want to actually look at lazy loading those.
Loading them in the background as opposed to actually loading
them as your instance starts.
Anything you can do to minimize the amount of time it
takes to start the applications is good.
And really, I think that's the key to handling things like
start up requests, things that will cause new
instances of starts.
It's basically just to minimize the time it takes to
load your application initially.
Only load what you need, lazy load and everything.
Don't load things you don't need to load.
And also make sure if you're using spring that you follow
the advice in the Google [INAUDIBLE]
and in that particular document on the website.
That will minimize your start up times, and you won't be so
worried about start up requests then when things
actually load a new instance, because it won't
take so long to do.
MALE SPEAKER: Yep.
All very good advice.
So definitely check out the Google I/O talk.
All the talks at I/O are going to be recorded.
So we can check those out.
Talk is happening next week.
So that's a great resource.
FEMALE SPEAKER: That's on Wednesday, by the way.
Are they live streamed?
MALE SPEAKER: Some of the talks are.
FEMALE SPEAKER: Some of the talks are live streamed.
MALE SPEAKER: I'm not sure if Matt's talk is live streamed.
You'll be able to catch it pretty soon.
Maybe something just say a little bit more in general
about App Engine Java especially these spring apps
or applications that have these big frameworks and long
loading times.
So one way to think about this is the way that we've been
building application servers for many years has been in an
environment where you would spin up, say, five application
servers, and these would be big servers that would sit on
a rack somewhere.
And they would take several minutes to kind of boot up, do
all the memory checks, right?
Machine would load up.
It would load the application server software.
Then it would load the specific applications.
And that whole process could take 10, 20 minutes sometimes.
But then those servers, they would run for weeks or months
or however long they needed to run.
And in that environment what you actually want to do is
kind of do all the expensive work up front when you're
loading the application, because you know you're only
going to do that one time, and then you're going to have long
lived servers,
App Engine tries to really kind of fundamentally deal
with applications in a different way.
When we want to scale up very quickly to handle an increase
in traffic to your website, or when we want to scale down
because there's a little bit less traffic coming in, we
really need the ability to quickly spin up new instances
of your application.
And then spin them back down kind of at a moment's notice.
And so App Engine's kind of optimized around apps that
have a very short start up time.
Ideally, it's hundreds of milliseconds.
Maybe it's a few seconds on the outset.
When you start getting into like 30 second time frames,
that's really a whole different ball park.
Now, if that's something you want to do, and you want to
run spring applications, and you say, I get a lot of
benefit out of that.
And why can't I just run an App Engine?
You can.
We actually, I think a year ago or so, we introduced some
extra knobs on the admin console
specifically for these users.
What you'll need to do is go into the admin console.
Make sure you enable billing, because that exposes all the
knobs that we have.
And then go into your application settings.
And there's a couple of settings around min max idle
instances, min max pending requests latency.
And those allow you to kind of tune the cost performance of
your application.
So if you know you have long loading requests, and you just
need to keep in a few extra instances around to make sure
you can handle those spikes, even though you have long
instances, you can actually crank up
the min idle instances.
On the other hand, if you're a fast starting app, and you're
very cost sensitive, there's ways to turn
it the other direction.
We recommend everyone start out with
the automatic settings.
But we do have some special knobs for that.
And I'm sure Matt, in his talk, will go into a lot more
detail than we did right here.
FEMALE SPEAKER: Yeah, definitely.
MALE SPEAKER: Specifically around Java applications.
So that's definitely something we care about.
And we'll have some advice for you.
FEMALE SPEAKER: Yeah, that's great.