Skip to content

How does strategy ordering work

Creating custom routing strategies

Once you have activated at least two CDNs for a domain, the Smart Load Balancing will start to work automatically.

You also have the option to create or customize your own routing strategy.

Creating a strategy

To create a routing strategy, go to ‘ DEM’ > 'Routing strategies'.

At first, you'll see a built-in strategy labeled as ‘Default’ which cannot be removed. This is the default intelligent traffic routing strategy powered by the VNIS decision engine which will route your domain traffic to the best performing CDN.

You can click 'Add strategy' to create a new strategy.

Currently, there are three types of strategies available:

  • Static routing: select single or multiple target locations and tell the system to always use a selected CDN for it. You can specify the country, or even down to the city and network level for the target location.

  • Best latency (Need to be enabled): always choose the CDN with the best latency, but you can also set an availability threshold to prevent the system from selecting a CDN with bad availability
  • Best availability (Need to be enabled): always choose the CDN with the best availability, but you can also set a latency threshold to prevent the system from selecting a CDN with bad latency.

To enable ‘Best latency’ and ‘Best availability’, go to ‘Marketplace’ > ‘DEM’. Then enable the ‘Dynamic routing’ Add-on.

After you create several routing strategies, you can assign the order of priorities of your strategies by following this article" "# How to integrate Stream Analytics into your video streaming app?

If you have a video streaming app, and you would like to integrate Video Stream Analytics into its videos, then you can follow this guide.

Video Stream Analytics provides engagement and Quality of Experience (QoE) insights of your videos. You can use these insights to identify problems with your videos, and also to gauge the conversion rate and success of your videos.

The figure below shows the process flow.

To do this in the platform, navigate to ‘ Stream’ > ‘Live Streams’, then click the ‘Create live stream’ button.

You will be directed to another page where you can set up the following:

  • Stream Details, and
  • CDN Configuration

Stream Details

The Stream details includes:

  • Stream source name: a unique name for the stream source.
  • Protocol: specify the video format/container of the video stream. For this scenario, choose HLS as the protocol.
  • Origin server: the origin server is where your video streams are hosted. Use the domain name associated with your origin server. And then set this origin as a ‘CDN candidate’.

CDN Configuration

By default, the system will recommend you to install Basic CDN by default, namely Alibaba Cloud.

If you just needed Stream Analytics, you are free to disable them later.

Optional: You may enable P2P delivery. You can check this article to learn more about P2P delivery.

Finally, click the ‘ Create stream’ button, to finish the setup.

The created stream will be integrated with Stream Analytics.

Generate the code snippet

VNIS Video Stream provides an easy way to integrate Stream Analytics into your web app or mobile app through the SDK.

SDK is available in 2 formats depending on the platform of your video streaming app: web SDK and iOS SDK.

Mltyics Video Stream will auto-generate code snippet containing the SDK for this video. You can then copy the code snippet into your streaming application.

To generate the code snippet, navigate to ‘ Stream’ > ‘Live Streams’.

On this page and under the section ‘ Stream List’, you can click the stream name of your selected live stream, and by doing so, this will direct you to the Stream details page.

On the Stream details page, go to the ‘CDN Load Balancer’ tab and then to the ‘CDN Configuration’ section.

Disable the CDNs except for the ‘Origin server’, and then click the ‘Save’ button.

The, go to the ‘ Install & Test’ tab.

On this tab, input the manifest (m3u8) URL of your target video under the ‘Playlist URL’ field. You can choose your preferred video player on this page.

The system will generate a code snippet containing all the configurations you set.

Copy the code snippet

After you finished the configuration on the ‘Install & Test’, you may now access the generated code snippet on the ‘ Code Snippet’ tab.

You also need to input the manifest (m3u8) URL of your target video under the ‘Playlist URL’ field (only for HLS protocol case).

You can click the ‘ Copy’ button to copy all the code snippet into your video streaming app code.

You can also open the ‘ See our docs’ link, to check more detailed instructions on how to input the code snippet for different platforms (web, or iOS), different players (Video.js, HLS.js, or DPlayer), and JS frameworks (HTML, React, Vue)" "# Managing routing strategies

The 'Routing strategies' feature is highly customizable, you can reorder strategies to prioritize the trigger order, delete it, and/or modify the strategy settings if necessary.

Double check the domain in consideration on the Operation level panel.

Reordering strategies

The strategy order dictates which strategy to trigger first depending on the network status in the location of a request.

To modify the order/priority, click the ‘Priority’ (‘numbered list’) button. Now drag and drop the selected routing strategies into the order you prefer.

Once you're done, remember to click the 'Reorder' button to save.

Deleting a strategy

You can delete a routing strategy you created by hovering over a strategy, and by clicking the ‘Trash’ icon.

You cannot restore a deleted strategy, please double check before proceeding.

Modifying a strategy

If you want to make changes to your strategy, you can hover over a strategy you would like to modify, and click the ‘Settings’ icon.

Modifying a strategy is exactly like creating a new one, you can select what type of strategy and customize it. Once you're done, hit 'Save' and you are good to go.

To understand how strategy ordering works, check this article" "# Is there a way to test routing strategy?

As described in this article, the strategy order dictates which strategy to trigger first depending on the network status in the location of a request.

VNIS has designed a tool to simulate which strategy among your list will be triggered given a test IP address (source of inbound request).

You can test which strategy will be triggered by clicking the 'Test' button.

First, enter an IP you'd like to test. The IP here represents the source of a request, and the system will use this information to run a simulation. Then, press the 'Test' button, to start the simulation on each strategy based on their priority.

Once a suitable strategy is triggered, the simulation will stop and mark the triggered strategy with a blue target symbol, together with a notification message of which strategy was triggered.

You can click 'Reset' to reset the results, and run a new test" "# How does strategy ordering work?

The strategy order dictates which strategy to trigger first depending on the network status in the location of a request.

The system set the top most strategy to have the highest priority, while the bottom most have the lowest. To understand how the strategy ordering works, let’s consider the example provided below.

Strategy list example:

Name Method Settings
test-01 Static routing Always use: Akamai, Target location: United States
test-02 Best latency Availability threshold: 70%
Default Auto Auto

Let's say your strategy list is ordered similar to the example above, and you have a user accessing your domain from the UK.

For this scenario, the system will first test the first strategy. However, since the first strategy targets requests from the US, the system will skip the first strategy.

Then the system will test the second strategy. If the system can find a CDN that has the best latency and at least 70% availability, then it will use this strategy and assign the request to that CDN.

However, if there were no CDN that was able to attain conditions set on the second strategy, then the system will use the default strategy, where it will choose the best CDN according to the default intelligent traffic routing strategy.

You can test how your strategy would work given a test IP (for inbound request) by following this article"