---
title: Traffic Shifting
weight: 52
---
:icons: font
:sectlinks:
:linkattrs:

In the previous link:../tutorial/#01-request-routing[Request Routing, window="_blank"] step we have deployed two new versions of the *travels* service using the *travels-v2* and *travels-v3* workloads.

That scenario showed how Istio can route specific requests to specific workloads. It was configured such each portal deployed in the *travel-portal* namespace (*travels.uk*, *viaggi.it* and *voyages.fr*) were routed to a specific *travels* workload (*travels-v1*, *travels-v2* and *travels-v3*).

This Traffic Shifting step will simulate a new scenario: the new *travels-v2* and *travels-v3* workloads will represent new improvements for the *travels* service that will be used by all requests.

These new improvements implemented in *travels-v2* and *travels-v3* represent two alternative ways to address a specific problem. Our goal is to test them before deciding which one to use as a next version.

At the beginning we will send 80% of the traffic into the original *travels-v1* workload, and will split 10% of the traffic each on *travels-v2* and *travels-v3*.

NOTE: *Step 1:* Use the Traffic Shifting Wizard on *travels* service

++++
<a class="image-popup-fit-height" href="/images/tutorial/05-03-traffic-shifting-action.png" title="Traffic Shifting Action">
    <img src="/images/tutorial/05-03-traffic-shifting-action.png" style="display:block;margin: 0 auto;" />
</a>
++++

{nbsp} +
Create a scenario with 80% of the traffic distributed to *travels-v1* workload and 10% of the traffic distributed each to *travels-v2* and *travels-v3*.

++++
<a class="image-popup-fit-height" href="/images/tutorial/05-03-split-traffic.png" title="Split Traffic">
    <img src="/images/tutorial/05-03-split-traffic.png" style="display:block;margin: 0 auto;" />
</a>
++++

NOTE: *Step 2:* Examine Traffic Shifting distribution from the *travels-agency* Graph

++++
<a class="image-popup-fit-height" href="/images/tutorial/05-03-travels-graph.png" title="Travels Graph">
    <img src="/images/tutorial/05-03-travels-graph.png" style="display:block;margin: 0 auto;" />
</a>
++++

NOTE: *Step 3:* Compare *travels* workload and assess new changes proposed in *travels-v2* and *travels-v3*

Istio Telemetry is grouped per logical application. That has the advantage of easily comparing different but related workloads, for one or more services.

In our example, we can use the "Inbound Metrics" and "Outbound Metrics" tabs in the *travels* application details, group by "Local version" and compare how *travels-v2* and *travels-v3* are working.

++++
<a class="image-popup-fit-height" href="/images/tutorial/05-03-compare-local-travels-version.png" title="Compare Travels Workloads">
    <img src="/images/tutorial/05-03-compare-local-travels-version.png" style="display:block;margin: 0 auto;" />
</a>
++++

{nbsp} +
The charts show that the Traffic distribution is working accordingly and 80% is being distributed to *travels-v1* workload and they also show no big differences between *travels-v2* and *travels-v3* in terms of request duration.

NOTE: *Step 4:* Update or delete Istio Configuration

As part of this step you can update the Traffic Shifting scenario to test different distributions. When finished, you can delete the generated Istio config for the *travels* service.
