June 2018
Intermediate to advanced
372 pages
8h 44m
English
Traffic splitting is useful when one or more URLs are referring to multiple versions of an application or a service. Traffic splitting can be used to accomplish pretty cool functionality such as A/B testing and green/blue deployments (more on these later).
It can be achieved through either the browser or the gcloud command line.
For example:
gcloud app services set-traffic [MY_SERVICE] --splits [MY_VERSION1]=[VERSION1_WEIGHT],[MY_VERSION2]=[VERSION2_WEIGHT] --split-by [IP_OR_COOKIE]
In the preceding command, the service name is the service you use. Version names can be of your choice, but the weight must be distributed in a way that the total of the weight becomes 1. For example, if you want to distribute traffic of my service ...