# Proxy connection and reuse best practices

Set production policies for timeouts, connection pooling, concurrency, retries, idempotency, and logging.

Stable access depends on a controlled connection lifecycle, rather than an infinite increase in the number of agents or retries.

## Timeout

- Configure DNS, connection, TLS, and read timeouts separately.
- Set a deadline for the entire request.
- After the timeout, the underlying request is cancelled and the connection is released.

## Connection pool

- Segregation by agent status and geographical location.
- Limit the maximum number of connections, idle connections, and idle time.
- Clearly specify whether reuse is disabled during rotation testing.

## Try again

- Only retry equal and safe replay requests.
- The indexes retreat and join the random shake.
- 407, parameter error and compliance refusal will not be retryed automatically.

## Logs and Indicators

- Record phase, timeout, status, request ID, and number of retries.
- Distinguish between proxy failures and target host failures.
- All credentials remain desensitized.
