GAE memory quotas should be per version per instance, not just per instance

53 views
Skip to first unread message

Bret Lowery

unread,
May 24, 2016, 6:03:16 PM5/24/16
to Google App Engine
Suppose GAE only supported a maximum of two versions per instance at 128MB max memory per instance on the default F1 config. Suppose Version 1 of your app uses exactly 64MB memory at startup. In that case, you can't start Version 2 of you app if it uses so much as one byte more memory than version 1, since 64MB + 64MB + 1 byte > 128MB. (Yes, it's a soft limit, but here's my point-->). What's the purpose of versions then? It isn't testing two versions side by side on the same instance in this case because one can't. 

I actually have this problem now. I have an app that starts up at 50MB and have added a feature that increases it to 100MB (some large in-memory hash lookups were added). However, I can't run them side by side on one F1 instance as I exceed my 128MB capacity, when *both individually* are under 128MB. 

I should be able to do this. What exactly is the point of GAE versions otherwise? I should be able to stand up both and route traffic to both via the provided features to do so without production failing due to this problem.

Also posted to Stackoverflow:



Bret Lowery

unread,
May 24, 2016, 6:35:04 PM5/24/16
to Google App Engine
FYI here is the error you get in the GAE log:

"<timestamp> Exceeded soft private memory limit of 128 MB with xxx MB after servicing yyy requests total" (xxx,yyy = some numbers)

Josh Moore

unread,
May 24, 2016, 7:01:47 PM5/24/16
to google-a...@googlegroups.com
For clarification, are you saying that if you only have one version available at a time, you can load the alternate version successfully?  

--
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 google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/80a91ad7-1d02-4f7a-876b-194f43f4a6bc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Josh Moore | Cloud Solutions Engineer | josh...@google.com | 

Bret Lowery

unread,
May 24, 2016, 7:29:47 PM5/24/16
to google-a...@googlegroups.com

Yes. I can load my new version fine and it runs fine alone, but I want to be able to test the new version on the prod instance before I swap traffic over to the new version. Otherwise I have to shut down the old version, shutting off live traffic when I switch while I test my new version before I officially send traffic to it. The great thing about versions to me is that I can run them simultaneously so I keep traffic up on prod and I test my prod environ on the new version at the same time.

 

For those who aren’t aware, you can run (or more!) two versions simultaneously on one instance. Example:

 

Say app.yaml version is set to “1”.

 

Version 1 (“default”) when deployed will run at http://yourprojectname.appspot.com

 

Change app.yaml version to “2” and upload.

 

Version 2 will upload to http://2.yourprojectname.appspot.com. It won’t become the default version at http://yourprojectname.appspot.com until you swap your live traffic over to it 100% (a feature available from the dashboard). Then, it automagically becomes http://yourprojectname.appspot.com.

 

But, in between, you can run side by side, and send GETs/POSTs directly to http://2.yourprojectname.appspot.com to unit test the new version while the previous version is still live as the default version on the default URL. That’s what I’m trying to do, and that as I understood it is why Google allows you to do it this way.

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/SpHldXOfJl0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.


To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.

Bret Lowery

unread,
May 24, 2016, 7:45:07 PM5/24/16
to google-a...@googlegroups.com

I’m working with Google now on this, providing monitoring, trace, other metrics. I don’t think it’s working as documented. Closing this thread.

Alex Martelli

unread,
May 24, 2016, 10:10:46 PM5/24/16
to google-a...@googlegroups.com
You can run many versions of your App Engine app (only one being the default), but what convinces you that they're going to be running on the same instance? To the best of my knowledge, multiple instances will be spawned as needed (indeed you could even be using e.g different instance classes in the different versions, since each version has its own app.yaml where things like instance class are specified).

Alex

Bret Lowery

unread,
May 24, 2016, 10:16:40 PM5/24/16
to google-a...@googlegroups.com

Thx for the feedback. I understand the instance-version relationship. I’m identical app.yamls between versions, only version “number” is different.

 

Based on measurements and timing I actually think I have a delayed garbage collection issue at this point (which explains the symptoms). I’m gathering metrics and traces now and trying different data that when loaded set my app to fixed memory sizes to test various cases.

 

Thx again for all comments, appreciated.

Reply all
Reply to author
Forward
0 new messages