
A proxy workflow that works for five minutes isn’t necessarily ready to run for five hours. Long jobs run into temporary network failures, slow destinations, unavailable exit IPs, expired sessions, rate limits, and restarts that a short test never reveals. You can’t eliminate every failure, so the real goal is to stop one temporary problem from wrecking the whole job.
That takes more than a list of proxy endpoints. A reliable workflow needs deliberate timeouts, controlled retries, the right session behavior, health checks, failover rules, checkpoints, and enough logging to explain what went wrong. This guide walks through each of them in order.
Why Long-Running Jobs Fail Differently
A short script might send 100 requests and finish before anything goes wrong. A long-running process can send tens of thousands over hours or days, so even a tiny failure rate becomes visible. Along the way it may hit connection resets, DNS errors, timeouts, HTTP 429 rate limits, HTTP 5xx server errors, unavailable exits, and malformed responses.
None of these has to stop the whole job. So the first design question isn’t “How do I prevent errors?” but “What should the application do when each type of error occurs?”
Start With Timeouts
Every remote request needs a timeout. Without one, a request can hang forever while the application waits for a destination or proxy that never answers. AWS’s guidance on timeouts, retries, and backoff treats timeouts as a basic safeguard against remote calls tying up resources indefinitely.
For proxy automation, set two limits: a connection timeout for establishing the connection, and a read timeout for receiving the response. Base the values on your real workload. Three seconds may suit a fast API but be far too short for a browser-rendered page, so set each limit on purpose instead of relying on a library’s default.
Retry Only the Failures That Can Recover
Retries help when a failure is temporary and make things worse when it’s permanent. Your retry policy should look at why a request failed:
| Failure | Retry? | Why |
| Connection reset or timeout | Usually | The next attempt may succeed |
| HTTP 502 or 503 | Often | The server may recover shortly |
| HTTP 429 | Later, not immediately | The destination is asking you to slow down |
| HTTP 404 | No | The same request returns the same result |
| Invalid credentials | No | The configuration needs fixing |
A rule like “retry every error five times” wastes time, adds traffic, and can push an overloaded service further over the edge. AWS warns about exactly this: retries add load to a system that may already be struggling.
Use Backoff, Jitter, and a Retry Limit
Suppose a destination goes down for 30 seconds and 500 tasks retry every second. Their retries create a fresh burst of traffic just as it tries to recover. Exponential backoff fixes this by doubling the wait between attempts: 1 second, then 2, then 4, then 8.
Adding jitter, a small random variation in each delay, spreads retries out further, so one worker waits 3.7 seconds while another waits 4.6. Every retry loop also needs a limit. A sensible default is up to three retries for temporary errors, after which the task is logged as failed and the job moves on, or the task goes into a queue to try later.
When a destination returns HTTP 429, slow down rather than retrying straight away. If the response includes a Retry-After header, wait at least that long. Respecting these signals protects the destination and keeps your own automation stable.
Match the Session to the Task
Retries are only part of reliability; the proxy session also has to fit the job. Some requests are independent: a job checking public pages in many locations doesn’t care whether request 50 uses the same IP as request 49. Others are stateful and depend on cookies, a server-side session, or consistent localization across several requests, so changing the IP midway can alter the result or break the session.
A rotating session changes the exit IP according to the provider’s rules, which suits independent requests. A sticky session keeps the same IP for a set period, which suits several requests that belong to one task. Choose per job, not globally:
- Checking one public page: rotating IP
- Following pages 1–10 of one localized sequence: sticky IP
- Running an authorized multi-step QA journey: sticky IP
- Starting an unrelated check: a new rotating session
Store the Session ID With the Job
Don’t generate a new session ID for every request. Store it with the job that owns it, for example job_8421 → session_8421, so every request in that job reuses it until the work is done. If the process restarts, the saved ID lets you decide on purpose whether to resume the session or start a new one.
Remember that sticky doesn’t mean permanent. An exit can disconnect, the provider may replace it, or the sticky window can expire. Your workflow should notice an unexpected IP change, then either continue, if the task allows it, or restart that task from its last checkpoint.
Learn Your Provider’s Session Rules
Providers implement sessions differently: some use ports, some use parameters in the username, and others use an API or dashboard. ColdProxy, for example, supports rotating and sticky sessions. Its Residential IPv4 plans hold sticky sessions from 5 seconds to 24 hours, while its IPv6 plans offer longer-lived options, and its documentation notes that a session’s IP can change if the exit stops working.
Before you build session handling into production code, write down how your provider creates a sticky session, how long it can last, what makes the IP change, and what happens when an exit becomes unavailable. That belongs in your application design, not just in the provider’s dashboard.
Build Failover in Layers
Failover doesn’t have to mean switching providers. A reliable workflow recovers in steps, using the smallest change that solves the problem:
- Retry the same request for a likely temporary error, keeping the same sticky session if the task needs it.
- Replace the exit IP if the current one stops working and the task doesn’t need continuity.
- Switch gateway or region if failures affect a wider route, without breaking the task’s location requirement. Don’t move a Germany-specific task to the United States just because the German route failed.
- Pause the queue if the destination itself is down, because cycling through ten different IPs won’t fix a site that isn’t responding.
- Use a backup path, such as a secondary gateway or provider, for high-value systems. Plan this in advance with clear routing rules, not as an emergency fix.
Check Health Before You Fail Over
Failover works better when your application knows which routes are healthy, rather than waiting for 500 failures to find out. A basic proxy health check measures connection success, latency, exit IP, location, and recent error rate. But an IP check alone isn’t enough, because a proxy can return a valid IP and still fail to reach the site you actually need.
For critical work, check two levels: proxy health (does the proxy connect and return a valid exit IP?) and workflow health (can that route reach your permitted target and return the expected response?). HostAdvice’s guide to monitoring VPS uptime and alerts makes the same point about servers: a ping reply doesn’t mean the server is actually working. Keep health checks at sensible intervals, too, so they don’t become a heavy workload of their own.
Stop Repeated Failures With a Circuit Breaker
A circuit breaker stops your application from repeatedly calling something already known to be failing. Microsoft’s Circuit Breaker pattern describes three states:
- Closed: requests flow normally.
- Open: the failure threshold is reached, so requests stop for a while.
- Half-open: after a pause, a few test requests go through. If they succeed, normal traffic resumes; if not, the circuit opens again.
In proxy automation, apply a circuit breaker to one gateway, destination, region, or upstream API at a time. Scope matters: a failing UK route shouldn’t stop healthy US work.
Save Progress With Checkpoints
Reliability also means a restart shouldn’t erase hours of finished work. A long job should regularly save a checkpoint: the job ID, the last completed item, the page or cursor position, the region, the session ID, and a timestamp. If a job processing 100,000 records crashes at record 87,000, a checkpoint lets it resume near 87,001 instead of starting again from record 1.
Store that state outside the worker process, in a database, persistent queue, or file, so a crash doesn’t wipe it. The worker then becomes replaceable: a new one can pick up the unfinished job from the saved state. HostAdvice’s guide to using proxies with VPS hosting for web scraping explains how a VPS keeps a job running after you close your laptop; checkpoints take the next step and keep it running after a single process fails.
Make Repeated Tasks Safe
A timeout doesn’t always tell you whether the remote action completed: the destination may have processed it and only the response was lost. For read-only public data collection, repeating a request is usually harmless. For anything that changes state, design the task to be idempotent, meaning that running it twice has the same effect as running it once, by using unique job IDs or deduplication. AWS gives the same advice: actions with side effects aren’t safe to retry unless they’re idempotent.
Stop Scheduled Runs From Overlapping
Many long-running jobs start from cron or another scheduler, as HostAdvice’s guide to automating server tasks with cron jobs explains. The risk comes when a run hasn’t finished before the next one starts: if an hourly job takes 75 minutes, two copies run at once. That causes duplicate requests and output, extra proxy load, and confused sessions, so use a lock file or a job queue to make sure only one copy runs at a time.
Log and Measure What Matters
A log line that says only “request failed” won’t help you later. For each failure, record the timestamp, job ID, destination, proxy gateway, region, session ID, attempt number, response code, error type, latency, and whether failover happened. Never write proxy passwords, tokens, or cookies to your logs, so diagnosing one problem doesn’t create a security risk.
Then judge reliability by rates over time, not single incidents. Track success rate, timeout rate, retry rate, latency, rate-limit responses, failover events, and job completion. A particularly telling metric is how many requests succeed on the first attempt: a system where 99% succeed immediately is far healthier than one where 20% need three tries, even if both eventually finish. Alert on patterns, such as a rising error rate, a region failing repeatedly, or no jobs completing, rather than on every single timeout.
Putting It Together: A Recovery Flow

Proxy request recovery flow · 3 failure paths
Every request runs with a timeout, and a good response is saved along with a checkpoint. When a request fails, the type of failure decides what happens next: a temporary error is retried with backoff, a broken proxy route triggers failover, and a destination that is down pauses the queue. The application should only move on to the next task when doing so won’t break session continuity or the task’s location requirement.
A Reliability Checklist
Before you let a proxy workflow run unattended, make sure you can answer yes to these questions:
- Requests: Does every request have a timeout? Do you retry only temporary errors, with backoff, jitter, and a retry limit?
- Sessions: Do you know which tasks need sticky sessions and how long they should last? Is the session ID stored with the job?
- Failover: Can the application change exits without breaking a task, and does regional failover keep the required location? Does it pause when the destination itself is down?
- Recovery: Is progress checkpointed outside the worker, and are repeated actions safe? Are overlapping scheduled runs prevented?
- Monitoring: Do you track success, retry, and latency rates? Are credentials kept out of logs, and do alerts fire on patterns rather than single errors?
If several answers are no, the workflow needs more work before it runs on its own.
Final Thoughts
Reliable proxy automation doesn’t come from finding an endpoint that never fails. Networks, destinations, and exit nodes all have temporary problems; reliability comes from controlling what happens next.
Set timeouts so requests can’t hang, retry temporary failures with backoff, and keep the same session when a task depends on it. Add health checks and failover rules, but don’t switch routes blindly. Above all, save progress outside the running process, so a workflow that hits trouble can recover, resume, and explain what happened instead of starting over.
