2 questions regarding migration from Flex to Standard

66 views
Skip to first unread message

Nicholas Swekosky

unread,
Sep 30, 2019, 12:42:28 PM9/30/19
to Google App Engine
I'm considering migrating from AppEngine Flex to AppEngine Standard and I have significant experience with both. I have 2 quick questions regarding the migration and figured would post them here. Any insight would be appreciated.

1. Let's say I have an AppEngine Standard service who's sole job is to pull from a PubSub subscription and do some work. Let's say some time has gone by and no work has been posted to that PubSub topic so my worker has scaled to 0. If something new has been posted to that PubSub topic, will that sandbox AppEngine Standard worker automatically scale to 1 to begin working again?

2. Let's say I have a service on AppEngine Flex that I'm considering migrating to AppEngine Standard. My existing service uses Google Cloud's golang libraries and I'm considering the amount of work it would take to migrate to the AppEngine Standard client libraries. For simplicity, let's assume I'm only using AppEngine, PubSub, OAuth, & Datastore. Could I only use the AppEngine Standard libraries to start the instance and use the Google Cloud libraries for PubSub, OAuth, & Datastore?

Please let me know if more detail is needed for these 2 questions. Thanks so much!

Vitaly Bogomolov

unread,
Oct 1, 2019, 1:24:24 AM10/1/19
to Google App Engine
Hi, Nicholas.


1. Let's say I have an AppEngine Standard service who's sole job is to pull from a PubSub subscription and do some work. Let's say some time has gone by and no work has been posted to that PubSub topic so my worker has scaled to 0. If something new has been posted to that PubSub topic, will that sandbox AppEngine Standard worker automatically scale to 1 to begin working again?

You can try this case by yourself, but (imho) - no, your AppEngine SE service won't start. The simplest solution is to call warmup request to start the instance of SE service.

WBR, Vitaly. 

Oqueli Martinez Sanchez

unread,
Oct 1, 2019, 8:58:50 AM10/1/19
to Google App Engine
Regarding your first question. As documented here [1] Your app Engine should be subscribed to receive push requests. A Pub/Sub subscription can be configured to send messages as an HTTP POST request to a URL which can be your App Engine Standard URL. On App Engine Standard you have at least two options managing App Scalation. If your App Scales to Zero, the HTTP Post from Pub/Sub will immediately "Wake up" your instance and execute the logic you have programmed. Take into account that "Waking up" your App Engine Standard instance would take some warm up time. You can also configure your app.yaml [2] to not scale to zero, and have a min_idle_instance value of 2 or 3 to handle the pubsub requests without warm up time involved. This is up to you. 

Regarding your second question.It is encouraged by Google to use the Product Client Libraries which have the Application Default Credentials included, for you not to struggle with authentication using Google's products. So yes, Start up your instance with the Standard libraries and use the product client libraries needed. 

Nicholas Swekosky

unread,
Oct 1, 2019, 8:58:50 AM10/1/19
to Google App Engine
Thanks Vitaly. I'll keep this in mind when experimenting tomorrow.

Nicholas Swekosky

unread,
Oct 1, 2019, 12:10:47 PM10/1/19
to Google App Engine
Totally missed those pages Oqueli. Thanks for pointing those out.

I must say that it was a bit difficult to find those so I'm glad you pointed them out. I'm a big fan of the documentation but it can be quite large to traverse sometimes.
Reply all
Reply to author
Forward
0 new messages