Cost limit

You can add up to 5,000 rules to a Cloudlets policy, but there is a maximum processing cost per policy that ​Akamai​ places on each request to prevent performance issues. Adding more than 1,000 rules to a single policy typically exceeds the cost limit, depending on your rules complexity.

For example, regular expressions are complex and have a very high processing cost, often 100 times more expensive than other match criteria. The actual number of rules processed per policy depends on the complexity of the regular expressions defined.

If your policy has more than 1,000 rules, or your rules aren't working as expected before reaching the 5,000 rules limit, consider the following solutions to reduce impact on a single request:

You can run this test to evaluate your policy cost per request and see if it is above the limit.

Test a policy cost

To measure the actual cost of a policy for a given request, set up a staging environment and add the X-Akamai-Cloudlet-Cost: True header to the request.
The response will contain a header with the number of CPU cycles used to apply the policy, which is the metric used to track the policy cost. The header format isX-Akamai-Tapioca-Cost-{ProductCode}: {CPUCycles}, where {ProductCode} is a short code corresponding to each Cloudlet product:

CloudletCorresponding code
Application Load BalancerABL
Audience SegmentationAS
API PrioritizationAP
Edge RedirectorER
Forward RewriteFR
Phased ReleaseCD
Request ControlIG
Visitor PrioritizationVP

The returned value reflects only the policy cost for that specific request. The worst-case cost occurs when evaluation reaches the final rule in the policy. Therefore, to determine the maximum policy cost, structure the request so that it evaluates all rules, for example, by ensuring that no rules match.

Actual policy cost can vary depending on the hardware powering the edge server processing the request, as well as current system load. As a result, when cost approaches the limit, some requests may exceed it while others do not. Repeated requests, even to the same edge server, can therefore produce a range of results. Although the hard cap is 1.33 million cycles per policy, it is recommended to leave a safety buffer and keep policy cost below 1 million cycles.

For example, the following curl reveals the ER cost for the given request:

curl -sD - -o /dev/null --resolve example.com:443:23.200.247.91 'https://www.example.com/' -H 'X-Akamai-Cloudlet-Cost: True' | grep 'Tapioca-Cost-ER'

The resulting response header is:

X-Akamai-Tapioca-Cost-ER: 698839

For this request, the policy cost is 698,839 CPU cycles out of the maximum of 1.33 million cycles.