Best Practices

Cleeng API Best Practices: Timeouts and Retries

Configuring an API timeout (the duration between sending a request and receiving a response) and retry policy is crucial for maintaining fluent end-user experience and reducing unnecessary strain on the infrastructure.

Cleeng API Performance

Cleeng Platform is highly optimized for handling large volumes of traffic. Our infrastructure will autoscale according to demand.

The usual latency for Cleeng API (calculated for API 3.1, at our API Gateway, using 1 hour median metric) is below 50 ms. The miniscule portion of the total traffic (below 0.01%) can be served with higher latency - up to a few seconds.

Throttling

We reserve the right to throttle the incoming requests or even block specific IP addresses, under certain circumstances:

  • When the traffic spike is too sudden, indicating machine-induced requests.
  • When the incoming traffic is identified as fraudulent, or a wide network/system scan.

Recommendations

  • Set up a default timeout of 8 seconds.
  • Only retry failed API calls once, to avoid an uncontrolled cascade of requests.
  • Use caching where possible, based on your use case.