Admin Settings: Number of Instances of my Application

72 views
Skip to first unread message

Ijaja

unread,
Apr 6, 2012, 7:51:44 AM4/6/12
to Google App Engine
Hi,

is there a way to restrict the number of instances for my application
to really one?!!

Using the slider, to set maximum instances to 1 does not seem to work.
I understand, that this is obvious only intended to restrict the
amount i have to pay,
but google spends nevertheless more instances. I want really to
restrict it, because
my application uses caching, which may result in inconsistent data
views!


greets, ijaja

David Hardwick

unread,
Apr 6, 2012, 6:08:53 PM4/6/12
to Google App Engine
That's the number of idle instances...no way to set limit on instances
that will be created that I'm aware of, but you could set the Pending
Latency (wait time to keep a request in the queue before spinning up a
new instance) to a very high value...do so though only understanding
the consequences.

Kyle Finley

unread,
Apr 6, 2012, 8:45:06 PM4/6/12
to google-a...@googlegroups.com
I would like to have this feature as well. It makes a lot of sense, especially for Go apps. A single Go instance can handle thousands of requests, and only takes up 6MB of ram leaving over 120MB for a cache.

If you create a feature request please post it here so I can star it.

- Kyle

Kwame

unread,
Apr 7, 2012, 6:42:38 AM4/7/12
to google-a...@googlegroups.com
The slider is not working for me either. This is the only way provided to restrict the number of instances of the app. I'm wondering if there's a bug in te system now.

David Hardwick

unread,
Apr 9, 2012, 9:00:58 AM4/9/12
to Google App Engine
Billing has to be enabled to use the slider.

András Belicza

unread,
Apr 9, 2012, 11:11:11 PM4/9/12
to google-a...@googlegroups.com
If you have billing enabled, you can set the min idle instances and the max idle instances separately.
Therefore if you sent the min and the max idle instances to 1, you will have 1 instance, a resident instance at any time.

Jeff Schnitzer

unread,
Apr 10, 2012, 12:32:28 AM4/10/12
to google-a...@googlegroups.com
It doesn't work that way.

Setting max idle instances to 1 changes the number of idle instances,
not necessarily the total number of instances.

There is no way to do what the previous poster wants to do - keep a
single instance in the cluster so he/she doesn't have to worry about
instance memory synchronization issues. GAE is not designed this way.

It is possible to create a single backend that works this way,
however. I'm not sure how - or if - you can direct traffic from a
"normal" domain name like www.example.com to a backend.

Jeff

2012/4/9 András Belicza <icz...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/5uwDJvTbJnAJ.
>
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.

Prashant Hegde

unread,
Apr 10, 2012, 2:08:21 AM4/10/12
to google-a...@googlegroups.com
If it helps, here is a write up on what we did to somewhat simulate the single instance.

Originally we had min instances = 1, max instances  =1. This was resulting in higher average latencies due to spinning off of instances. Our warm ups takes around 20 seconds, but it only warms up and does not heat up so the first request after the warm up was taking 6-7 seconds. The scheduler is designed to keep the constraint min instances = 1, and so, we were seeing unnecessary instances. Our goal was to get to a single instance and eliminate warmups. To that end, We made the following changes to get mostly a single instance behavior.

1) We set min instances = auto.


=======
Note: If you set a minimum number of idle instances, the Pending Latency controls will have little or no effect on your app's performance. See Minimum Idle Instances for more information.
======

So, with min instances = auto, scheduler will start honoring Min Pending Latency and Max Pending Latency.

3. We set max instances = 1. This is because thats what our app needs, and thats what our pockets allow as of now. 

4. We set the minimum pending latency as 7.5seconds. This was chosen because, we felt that by waiting for 7.5 seconds there is a high likelihood that already serving instance will become free. We have Java with multi thread enabled,  with average request latency is < 1 second and request rate is ~ 1 req/s.

5. We set the maximum pending latency to = 15 seconds. If for some reason app engine was not able to start an instance until 15 seconds ( from 7.5 seconds onwards), we wanted it to immediately start after 15 seconds.  

Results:

Pros:

Now, 99% of requests go to a single instance. 

Cons:

App engine does not send warm up requests for new instances  if min instances is not set ( don't know why). So, in the rare event that a new instance gets started and the request sent to the new instance, users are likely to see 20 second delay which is our startup time. Not the most ideal scenario, but, we are living with this trade off at the moment.

Prashant


Reply all
Reply to author
Forward
0 new messages