How many users could a single instance handle concurrently before it runs 
out of memory now? 

If you know deterministically how much memory a user request will require 
you can implement some logic in your app to slow/pause the request 
processing in the instance when it is close to running out of memory. As 
the request latency grows (because you're slowing requests at the instance 
level) then more instances will be added to handle the users load. 
Basically you just queue requests at the instance level.

On Tuesday, 21 July 2015 10:48:05 UTC-7, Alex Kerr wrote:
>
> Thanks Patrice. Your second document refers to Python. I'm using PHP - are 
> the same options applicable to that too?
>
> I'm just wondering what to do when there are sufficient numbers of users 
> of my website (at any given time) to cause the running instances to run out 
> of memory. Logically, the thing to do would be to get more instances fired 
> up while the extra requests are coming in. I really need a simple, 
> automated as possible solution (hence why I'm using app engine). If it 
> doesn't respond to memory usage directly, is there a way to instruct or 
> trick the App Engine autoscaler to initiate more instances (i.e. trigger it 
> to do so based on some other metric)?
>
> Surely there has to be some alternative here to my users seeing my app 
> fail due to out of memory errors!?
>
> Thanks,
> Alex
>
> On Tuesday, July 21, 2015 at 6:37:08 PM UTC+1, Patrice (Cloud Platform 
> Support) wrote:
>>
>> Hi Alex,
>>
>> Scaling doesn't really happen based on memory, but based on latency and 
>> number of requests. It's highly tied into your scaling settings (either 
>> manual, automatic, or basic), and which exact config you have. You can 
>> lookup this document <https://cloud.google.com/appengine/docs/scaling> that 
>> contains some information on scaling, or this one 
>> <https://cloud.google.com/appengine/docs/python/modules/#Python_Instance_scaling_and_class>
>>  
>> which explains the configuration you can setup (look a bit further down 
>> than my link, it includes how to setup the three types of scaling and the 
>> options available to you)
>>
>> But to answer "can we have autoscaling when an instance run out of 
>> memory", not on App Engine directly. One thing you definitely can do is to 
>> use ManagedVMs <https://cloud.google.com/appengine/docs/managed-vms/> 
>> and the beta autoscaler 
>> <https://cloud.google.com/compute/docs/autoscaler/>, which you can set 
>> to "target utilization level" based on CPU utilization 
>> <https://cloud.google.com/compute/docs/autoscaler/scaling-cpu-load-balancing#scale_based_on_cpu_utilization>
>> .
>>
>> Since app engine scales a bit differently, there is definitely a way to 
>> do it, but it would be a workaround that would be way more involved than 
>> simply switching to ManagedVMs, so I wouldn't recommend it, as it would be 
>> clunky, might degrade customer experience (by making your whole app a tad 
>> slower).
>>
>> Cheers!
>>
>> On Monday, July 20, 2015 at 4:07:05 PM UTC-4, Alex Kerr wrote:
>>>
>>> Hi,
>>>
>>> I've got a PHP app running in standard AppEngine. It does use a bit of 
>>> memory for in-app image manipulation. I'm wondering what happens when there 
>>> are enough concurrent users of my web app that the current instance(s) 
>>> don't have the memory to handle more users (i.e. so it's not a CPU load 
>>> issue, or other things (?) that might cause the app to scale). I don't want 
>>> the users to see errors or a non-working app, I just want the AppEngine 
>>> autoscaler to add another instance(s).
>>>
>>> Is this how things work? If not, is there a way to get autoscaling to 
>>> happen on the basis of current instances running out of memory?
>>>
>>> Many thanks!
>>> Alex
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/73c8416d-a028-4c7f-a280-7c0d62f5c63e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to