Configure Fastly rate limits in Adobe Commerce on Cloud infrastructure

Fastly’s rate-limiting setup in Adobe Commerce on Cloud infrastructure delays requests and returns HTTP 429 (Limit Exceeded) errors when thresholds are breached. To fix the issue, update the tarpit interval in Fastly’s VCL snippet.

Description description

Environment

Adobe Commerce on Cloud infrastructure, v2.4.4 - 2.4.8-p2

Issue/Symptoms

  • Fastly returns HTTP 429 (Limit Exceeded) errors when request thresholds are exceeded.
  • Requests slow down due to the enforced tarpit interval and penalty duration.
  • The cooling-off period duration isn’t clearly defined or accessible.
  • There’s no straightforward way to retrieve or modify the tarpit interval, its role, and how it can be adjusted.

Resolution resolution

Fastly uses a sliding window algorithm to enforce rate limits based on configurable parameters like request thresholds and penalty durations. To understand and adjust these settings, follow these steps:

  1. Fastly enforces rate limits over a rolling time window (For example, 3600 seconds). When an IP exceeds the threshold:

    • Fastly returns an HTTP 429 (Limit Exceeded) response.
    • Blocking continues until the request count drops below the threshold within the window.
    • Adobe Commerce initiates rate-limiting by sending a 429 response to Fastly, which then places the IP in a tarpit—a temporary slowdown zone.
  2. Adobe Commerce uses the tarpit interval to slow down requests from IPs that exceed rate limits. When triggered, it introduces a delay—defaulting to 5 seconds—before processing further requests. You can adjust this interval through Fastly’s API.

  3. To change the tarpit interval in Adobe Commerce on Cloud infrastructure, follow these steps:

    1. Get your Fastly API token for authentication.
    2. Use the Fastly API to fetch your service’s active VCL configuration.
    3. Locate the magentomodule_rate_limiting_deliver snippet.
    4. Update the tarpit_interval parameter to your desired value (For example, increase from 5 seconds).
    5. Upload the modified VCL configuration using Fastly’s API endpoints.
    6. Activate the updated version to apply the changes.

Additional Notes:

  • These settings apply specifically to Adobe Commerce’s integration with Fastly.
  • Always test configuration changes in a staging environment before deploying to production.
  • For detailed guidance on editing VCL snippets or using Fastly’s APIs, refer to Fastly’s official documentation or contact the support team.
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f