Slow page loading when instance scheduler restart the only idle instance.

50 views
Skip to first unread message

Tapir

unread,
Sep 30, 2011, 3:13:29 AM9/30/11
to Google App Engine
If "Max Idle Instances" == 1, then there will be only one idle
instance.
This instance will restart every some minutes.
If a visit comes when this instance is restarting, slow page loading
occurs.

It seems the current scheduler implementation is "showdown the old
instance firstly, then create a new one".
If the scheduler firstly create and initialize the new one, then
shutdown the old one, slow page loading problem will go.

Simon Knott

unread,
Sep 30, 2011, 4:14:48 AM9/30/11
to google-a...@googlegroups.com
Hi,

The "Max Idle Instances" doesn't mean there will only be one idle instance.  It means that at most you will be charged for one idle instance, should the scheduler decide to spin up a few to handle any increase in load. 

Once the new pricing scheme comes in, there will be a new setting called "Min Idle Instances" which will do what you want - ensure that there is a minimum number of instances available to handle incoming load, removing the loading issues for that first request.

Cheers,
Simon

Alexander Konovalenko

unread,
Oct 2, 2011, 4:07:33 AM10/2/11
to google-a...@googlegroups.com, tapi...@gmail.com

If I understand correctly, you have tested it so this is not
theoretical. It looks like this would be a good issue to file in the
issue tracker. Could you please post a link to the issue here when you
file it?

Do you have Always On enabled? I wonder how often does the instance
restart. How many requests does it handle between restarts? Are there
any time periods when there are no instances or more than one
instance?

-- Alexander

Tapir

unread,
Oct 2, 2011, 4:59:23 AM10/2/11
to Google App Engine


On Oct 2, 4:07 pm, Alexander Konovalenko <alex...@gmail.com> wrote:
> On Fri, Sep 30, 2011 at 13:13, Tapir <tapir....@gmail.com> wrote:
> > If "Max Idle Instances" == 1, then there will be only one idle
> > instance.
> > This instance will restart every some minutes.
> > If a visit comes when this instance is restarting, slow page loading
> > occurs.
>
> > It seems the current scheduler implementation is "showdown the old
> > instance firstly, then create a new one".
> > If the scheduler firstly create and initialize the new one, then
> > shutdown the old one, slow page loading problem will go.
>
> If I understand correctly, you have tested it so this is not
> theoretical. It looks like this would be a good issue to file in the
> issue tracker. Could you please post a link to the issue here when you
> file it?
I have filed it here:
http://www.google.com/url?sa=D&q=http://code.google.com/p/googleappengine/issues/detail%3Fid%3D6015%26thanks%3D6015%26ts%3D1317427386&usg=AFQjCNGx_17XfNWwjxd0Bu_eu2kiLJ9Z3Q

>
> Do you have Always On enabled? I wonder how often does the instance
> restart. How many requests does it handle between restarts? Are there
> any time periods when there are no instances or more than one
> instance?
I don't enable "Always On", for I think I don't need it.

>
>  -- Alexander

Tapir

unread,
Oct 2, 2011, 5:07:52 AM10/2/11
to Google App Engine


On Oct 2, 4:07 pm, Alexander Konovalenko <alex...@gmail.com> wrote:
My app traffic is very small now. This is the pain.
I just found the scheduler doesn't restart the idle instance
automatically, or doesn't restart the idle instance when the instance
is idle.
Instead, it restarts the idle instance when a visit comes. This is so
bad. It will make the just coming visit wait for more than 10 seconds.
In the issue I filed, I suggest the scheduler should prepare a new
instance before shutdown the old idle instance. This way, there will
always an idle instance for coming requests.


>
>  -- Alexander

Tim Hoffman

unread,
Oct 2, 2011, 5:22:10 AM10/2/11
to google-a...@googlegroups.com

Hi


 
My app traffic is very small now. This is the pain.
I just found the scheduler doesn't restart the idle instance
automatically, or doesn't restart the idle instance when the instance
is idle.



Instead, it restarts the idle instance when a visit comes. This is so
bad. It will make the just coming visit wait for more than 10 seconds.

This is correct behaviour as documented, and extensively discussed over the last few months. 

Currently if you are an always on customer 
In the application settings you have two sliders, min idle instances and max idle instances.
Min idle instances sets the minimum number of idle instances that will always be present.
Once the new billing is in place, you will get a min idle instances slider.
 
In the issue I filed, I suggest the scheduler should prepare a new
instance before shutdown the old idle instance. This way, there will
always an idle instance for coming requests.

This isn't an issue.  I really think you need to reread all of the current documentation and discussions in this area, as you 
are definately misunderstanding the intent of max idle instances.

Also you need to do something about your 10sec startup time or pay for idle instances ("always on" at the moment)

Tim
 

>
>  -- Alexander

Tapir

unread,
Oct 2, 2011, 5:40:27 AM10/2/11
to Google App Engine


On Oct 2, 5:22 pm, Tim Hoffman <zutes...@gmail.com> wrote:
> Hi
>
> > My app traffic is very small now. This is the pain.
> > I just found the scheduler doesn't restart the idle instance
> > automatically, or doesn't restart the idle instance when the instance
> > is idle.
>
> Instead, it restarts the idle instance when a visit comes. This is so
>
> > bad. It will make the just coming visit wait for more than 10 seconds.
>
> This is correct behaviour as documented, and extensively discussed over the
> last few months.
This problem mentioned in this thread may do the same as documented.
But the one in this thread doesn't.
http://groups.google.com/group/google-appengine/browse_thread/thread/fa88cb15fe5c22c0/4aab990b3b2efc8e?lnk=raot&pli=1
You can see the instance status snapshots in this thread:
http://groups.google.com/group/google-appengine/browse_thread/thread/9dc347efd7527373
The scheduler often tries to create new instances even of there is a
instance is idle, and even if I set the "Max Idle Instances" to 1.
If the scheduler doesn't try to create new instance and use the idle
instance to handle the just incoming request, then there is no slow
loading problems.
But in fact, the scheduler gilds the lily.

And about the problem mentioned in this thread, I don't think the
documented way is good. So I made a suggestion.

>
> Currently if you are an always on customer
> In the application settings you have two sliders, min idle instances and max
> idle instances.
> Min idle instances sets the minimum number of idle instances that will
> always be present.
> Once the new billing is in place, you will get a min idle instances slider.
>
> > In the issue I filed, I suggest the scheduler should prepare a new
> > instance before shutdown the old idle instance. This way, there will
> > always an idle instance for coming requests.
>
> > This isn't an issue.  I really think you need to reread all of the current
>
> documentation and discussions in this area, as you
> are definately misunderstanding the intent of max idle instances.
Yes, I read them all.

>
> Also you need to do something about your 10sec startup time or pay for idle
> instances ("always on" at the moment)
I don't want to change the struts2 framework. Other frameworks may be
load faster, but there will be other losses.
And I don't want to pay for my small website traffic.


>
> Tim
>
>
>
>
>
>
>
>
>
> > >  -- Alexander

Tapir

unread,
Oct 2, 2011, 5:46:27 AM10/2/11
to Google App Engine


On Oct 2, 5:22 pm, Tim Hoffman <zutes...@gmail.com> wrote:
Surely, if the "always on" feature is always $9/month, I really will
want to pay for it.
But under the new price model, this feature will cost $100/month.
No ways let me pay for it, except my website traffic becomes large.

>
> Tim
>
>
>
>
>
>
>
>
>
> > >  -- Alexander

Francois Masurel

unread,
Oct 2, 2011, 10:55:05 AM10/2/11
to google-a...@googlegroups.com
I think I encounter the same problem for one of my app.

I've Max Idle Instance set to 1 and Min Pending Latency to 15s, but still, from time to time, a new instance is started, often to serve only 1 request.

I would say there is nothing wrong about that  besides the fact that this new instance is used to serve a user facing request.  So the user has to wait until the new instance is fully loaded (~10s in my case). Usually all following requests are served by the original instance and the new one is shut down rapidly.

It happens periodically for me, most of the time for https requests (Facebook app).

Any help will be greatly appreciated.

Francois
Reply all
Reply to author
Forward
0 new messages