Thanks Stuart. That sounds good and I was starting to think along those 
sorts of lines.

But how would I assess how much memory a user request uses? Are there 
particular PHP commands or AppEngine or Cloud Console features I could use 
to determine this?
And secondly, how do I assess how close to the instance memory limit I am 
(at least from the PHP perspective)?

Currently instances seem to be a bit of a black box to me - not sure how 
close to resource limits I am with any particular code I run - would love 
any tips on determining this! (e.g. also for using VFS etc.)

Many thanks

On Wednesday, July 22, 2015 at 2:27:33 AM UTC+1, Stuart Langley wrote:
>
> 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/277c371d-9495-4eca-9c7c-298362988381%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to