Google App Engine - Split Traffic and promote

183 views
Skip to first unread message

Bilal Haidar

unread,
Jun 15, 2021, 8:28:05 AM6/15/21
to Google App Engine

Hi,
I would like to understand the relation between --promote (--no-promote) and split traffic.

- When I make a version deployment (--promote), it means it takes 100% of the traffic
- When I make a version deployment (--no-promote), it won't take any traffic percentage. However, would I be able to visit this version by URL? Would this version be stopped or active?
- Split Traffic it works sort of against (--promote). We use it when we want to split the traffic among versions instead of promoting a single version.

I am planning to have two versions of my app. One is prod and another staging.

Only prod should serve clients. While staging should only be used internally for testing, etc.

Shall I use --promote with the prod environment and --no-promote with the staging one?

Thanks
Bill

Patrice Bertrand

unread,
Jun 15, 2021, 10:34:11 AM6/15/21
to google-a...@googlegroups.com
Hello Bill,

Maybe you should consider using 2 distincts projects instead of versions for the need that you describe.  This will allow you to use versions as proper versions, and to handle a version change within a given service.

Alternatively, you could consider using 2 services, each with versions as needed.

Using different projects or different services of a project should not affect your costs, since you are paying for live instances ultimately.

Patrice
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/bca3d802-dbea-43ee-8348-43c0ad3007a5n%40googlegroups.com.

Bilal Haidar

unread,
Jun 15, 2021, 10:43:01 AM6/15/21
to google-a...@googlegroups.com
Thanks Patrice!

Can you explain to me or refer me to a resource on the real use of versions? I must have misunderstood it.

Many thanks
Bilal

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/kJO6TBILzxI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/6e7bd439-3cd2-abff-7abd-0462ca1f0620%40gmail.com.

Patrice Bertrand

unread,
Jun 15, 2021, 11:13:47 AM6/15/21
to google-a...@googlegroups.com
Sure.  Note that I'm just a regular user. 
I think it is best if "versions" in terms of GAE deployment match "versions" in terms of your Git, i.e. a consistent state of your project's files.
Thus there will be occasions when you need to change version for your production environment.    In such cases you would deploy your new version with --no-promote, then start the new version then migrate, or if you have a heavy traffic with many instances started you would split traffic then gradually increase the share sent to the new version, up to 100%, then stop the previous version (or let it stop).    Within your staging project (or possibly 'service'), you might also need to handle versions, and a given version might be deployed to the staging project and when validated, deployed to the production project.  So if you were using versions as environments  you would have very little flexibility in managing actual versions.
Patrice
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/CAFDSF-2zBPCZaqdkH_Bv-n7BvYkiDXLXv%2BKAgf4U2%2BnqGBw1oA%40mail.gmail.com.

--
logo ExperQuiz Patrice Bertrand
Directeur Associé
06 60 11 00 09
www.experquiz.com



Bilal Haidar

unread,
Jun 16, 2021, 10:18:23 AM6/16/21
to google-a...@googlegroups.com
Thanks, Patrice, for the valuable information.

In practice, I test and verify Staging. Once we are happy with it, we merge the "develop" branch on the "main" branch and then production takes the latest changes.

However, with versions, every new build of the app, could be a new version. Instead of making the new version --promote right away, we could make it --no-promote, then split the traffic so that both versions start receiving traffic, until the old version is stopped.

Is this entire process of moving to the new version automated somehow? Or we have to do it manually?

And what are the cons of just moving to a new version right away? 

George (Cloud Platform Support)

unread,
Jun 16, 2021, 12:46:20 PM6/16/21
to Google App Engine
Hello, 

You are right, you can use traffic splitting to specify a percentage distribution of traffic across two or more of the versions within a service, as detailed on the "Split Traffic" page. Deploying with --promote would attract all traffic to the deployed version. However, by contrast, traffic splitting is applied to URLs that do not explicitly target a version. In other words, you'll need 2 separate services, one for your prod environment, the other for staging. Two versions would not work for traffic splitting. 

You can access different versions by version URLs at any time. 

Bilal Haidar

unread,
Jun 16, 2021, 1:34:23 PM6/16/21
to google-a...@googlegroups.com
Oh thanks George!

Either I use two services of the same code base one for prod and one for staging. Or opt for two projects, one for prod and the other for staging?

Then, traffic splitting works against a single service (without the version specified in the URL). In other words, traffic is split among the versions of the service and not among two different services.

Is there a way to automate moving from one version to another gradually?

--
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/kJO6TBILzxI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.

Jordi (Google Cloud Platform Support)

unread,
Jun 22, 2021, 11:18:52 AM6/22/21
to Google App Engine
Hello, 

To move from one version to another gradually you should take a look at Traffic migration. [1]
Note that this is not supported in the App Engine flexible environment.

Reply all
Reply to author
Forward
0 new messages