When applied to a Filter Chain configuration, the Shed Load filter distributes DNS traffic intelligently across multiple endpoints based on load-related metrics — such as the load average, the number of active connections, or the number of active requests. This filter is often used to configure automatic load shedding in which the NS1 platform automatically slows or stops traffic to DNS endpoints as their load metric exceeds the specified low or high watermarks.
Upon each DNS query, the Shed Load filter evaluates the load-related metadata field for each answer (i.e., endpoint) within the DNS record. If the value meets or exceeds the defined low watermark value, the NS1 platform slows traffic distribution to the associated endpoint (i.e., it returns the answer less frequently), opting instead for more available endpoints. If the load metadata value meets or exceeds the high watermark value, the platform stops directing traffic to that endpoint altogether (i.e., it stops returning the answer) until conditions improve.
The filter can be configured to observe one of the metadata fields below.
Warning
The metric type label is nominal, and the actual definition depends on the user-defined script that pushes data to the NS1 platform.
-
Load average (
loadavg
)This is the default setting. Generally, this setting causes the platform to distribute traffic to the endpoint with the lowest load average. This value must be a positive decimal number with one digit of precision, e.g., 1.0.
-
Active connections (
connections
)Generally, this setting causes the platform to distribute traffic to the endpoint with the least number of active connections. This value must be a positive integer between 0 and 2^32.
-
Active requests (
requests
)Generally, this setting causes the platform to distribute traffic to the endpoint with the least number of active requests. This value must be a positive integer between 0 and 2^32.
During configuration, you will select one of the options above and specify low and high watermark values (i.e., thresholds).
Note
The low and high watermark (i.e., threshold) values can be applied to an individual answer, an answer group, or to the entire record (including all associated answers).
The Shed Load filter evaluates each answer using the following logic:
-
Does the answer have the relevant metadata? If not, the filter will not take any action on that answer. Similar to the Up filter, answers without the relevant metadata remain in the answer pool.
Note
Unlike some NS1 filters that eliminate answers without relative metadata from the answer pool (e.g., the Up filter), this filter does not eliminate answers if they are missing relevant metadata.
-
Does the answer have the necessary threshold values set?
-
If the load metric is below or equal to the low watermark, the answer remains in the answer pool.
-
If the load metric is above or equal to the high watermark, the answer is removed from the answer pool.
-
If the load metric is between the low watermark and high watermark, the Shed Load filter removes the answer at a frequency equivalent to the distance it is between those two points. For example, if the low watermark is set to a value of 80, the high watermark is set to 90, and the calculated load metric value is 82, that particular endpoint would be removed from the list of available answers 20% of the time. If the calculated load metric value is 88, that particular endpoint would be removed from the list of available answers 80% of the time.
-
Note
After each answer is evaluated, if none of the answers meet the criteria (i.e., they all exceed the low or high watermark), then all answers are returned and, if applicable, passed to the next filter in the Filter Chain. In other words, if the load-related metric indicates that all answers are under-performing or overloaded endpoints, then the Filter Chain skips the Shed Load filter to avoid eliminating all answers from the answer pool.
Automatic load shedding is a configuration in which a monitor or data source is attached to a DNS answer so it can update the load metric within the answer metadata as conditions change. This ensures that the filter is referencing the latest load-based data to inform traffic distribution decisions.
To configure automatic load shedding, you must configure a data source (e.g., NS1 monitor, NS1 data source, or third-party integration) and an associated data feed that you will attach to the DNS answer. Refer to Understanding NS1 data sources and data feeds for details.
Follow the instructions below to configure automatic load shedding.
Note
Before you begin, ensure you have created a DNS zone, a record within that zone, and answers within the record — each answer corresponding to an individual endpoint in your network.
-
In the NS1 portal, navigate to Integrations and select the Data Sources tab.
-
Click the + button in the upper-right corner to add a new data source and select a data source type. You can choose a native NS1 API source or any of the third-party integrations displayed.
-
Enter a name for this data source to be used for internal reference only, then click Save data source.
-
Confirm that you want to create a data feed associated with this data source by clicking Create a new feed with this data source.
-
Create the data feed. Specify a name and a label . Similar to a data source, the name is used for internal reference only. The label is a short, simple string that represents the service associated with the data feed (e.g., facility name, server name, and the like). Click Save feed to create the new feed.
-
Repeat this process to create additional data sources and feeds that you will connect to the DNS answers. Note that you can create multiple data feeds associated with the same data source. To do this, navigate to the Incoming Feeds tab and click the data source's icon to create additional feeds from the existing data source.
-
If you are not currently on the Integrations page, select it from the top navigation. On the Incoming Feeds tab, you can find Feed URLs for your data feeds.
-
Run the following API call to push load metrics from each server to NS1, replacing
$API_KEY
with your unique API key created within the NS1 portal,London-UK
with the label associated with your data feed, and theloadavg
field and value (e.g.,5.0
) with your chosen metric (loadavg,
connections
, orrequests
) and corresponding value.curl -X POST -H "X-NSONE-Key: $API_KEY" -d '{"London-UK":{"loadavg":5.0}}' https://api.nsone.net/v1/feed/<feedID>
-
Click DNS in the top navigation. By default, the Zones page displays, showing a list of zones associated with your account. Locate and click the name of the zone containing the record on which you want to configure automatic load shedding. If you haven't already, add a record to the zone, including all of the associated answers (i.e., endpoints). Otherwise, click the name of the record to view record details.
-
Click Create Filter Chain. The Add Filters modal opens.
-
Add the Up and Shed Load filters to the Filter Chain by clicking the + button next to those filters in that order. Add any other filters you want to include in the configuration.
Note
The order of filters (from top to bottom) determines the order in which filters are used to process each DNS query.
-
Under the Active Filters list, select the Shed Load filter to show the filter description and options. Scroll until you see the drop-down menu of metrics that the filter should reference when selecting the best-available endpoint. The possible options are load average, number of active connections , or number of active requests . Select one of these options.
-
Save the Filter Chain.
-
Back on the record details page, click the Up filter. The up metadata option displays as unset under each answer. Click the tag to open the Answer Metadata modal. You can set the status manually or click the feed icon to select a monitor. Click OK to save the metadata. Repeat for each answer in the answer list.
-
Click the Shed Load filter in the Filter Chain list. The metadata options available to you appear under each answer. Select your load metric from the metadata tags (one of loadavg, connections, or requests ) to open the Answer Metadata modal.
-
Click the feed icon next to the metric you have chosen, then select the monitor or data feed that you want to attach to this answer's metadata. The monitor or feed will be set to update the metadata automatically with the latest load-related measurement.
-
Next, select Low watermark in the Settings column. Enter the low watermark value. While still in the Answer Metadata modal, under the Settings column on the left, click Low watermark. Enter a number to represent the low watermark value.
-
Similarly, click the High watermark setting, then enter a high watermark threshold. After you have finished, click OK to save the metadata for the answer.
-
Repeat steps 7–10 for each answer in the record. After you have finished, click Save record to save your changes.
Note
If you are testing the configuration and would like to generate an example response, add
-i
to the cURL command. Additional methods and examples of interacting with our API can be found at https://ns1.com/api.
Now, the load-related metadata for each DNS answer in this record will be updated automatically as network conditions change. When a DNS query is made against this record, the Shed Load filter evaluates the latest load-related metadata for each answer to determine the optimal, or most available, answer(s) to return to the requesting client (or pass to the next filter for additional processing).