Short answer: use datacenter proxies by default and residential proxies only for hosts where datacenter ban rates exceed roughly 20%. Datacenter is about 3-5x faster and 5-10x cheaper per request. Residential wins on protected targets, where it can cut ban rates from 15-40% to 3-8%. Route per host from measured outcomes, and keep probing the cheap tier.
The Problem & Architectural Baseline
Most proxy decisions get made off a price sheet: residential at a few dollars per GB, datacenter at pennies. Six weeks later the real bill arrives as retries. A residential-only pipeline pays consumer-grade bandwidth rates for pages a $1 datacenter IP would have fetched without complaint. A datacenter-only pipeline looks cheap right up to the first target that scores ASN reputation, and then success rate falls off a cliff while the retry queue quietly multiplies your traffic.
The metric that matters is cost per successful page, not cost per request:
cost_per_success = cost_per_attempt / success_rate
A tier that is 5x cheaper per attempt but succeeds 15% of the time costs more than the premium tier at 90%. Residential bandwidth is billed whether the response was a product page or a CAPTCHA interstitial, so every blocked attempt is paid for twice: once to fail, once to retry.
The tiers fail in different ways, which is why the choice is architectural rather than a vendor preference:
| Dimension | Datacenter | Residential |
|---|---|---|
| IP origin | Hosting ASNs (public, enumerable lists) | Consumer ISP ASNs |
| Billing | Per IP per month, or cheap per GB | Per GB, typically the $3-10 range (check current vendor pricing) |
| Latency | One hop to a rack | Extra hop through a consumer last mile |
| Typical failure | Pre-emptive 403 on the first request | Exit churn, slow peers, mid-stream resets |
| Scaling limit | IP count and per-IP rate limits | Gateway plan, bandwidth, concurrent sessions |
A WAF can reject a datacenter IP before it reads a single header, because the ASN is already on a list. Residential exits dodge that check, but you inherit the variance of someone’s home connection. Neither tier fixes a bad client fingerprint, which we get to in the edge-case section.
The position this article argues: default to datacenter, escalate to residential per host based on measured ban rate, and keep probing the cheap tier so you de-escalate when a target relaxes. Everything below exists to measure that decision instead of guessing it.
System Architecture / Request Flow
URL queue (SQLite / Redis list)
|
v
+---------------+ reads last N outcomes per host +------------------+
| Tier Router |<-----------------------------------| samples table |
+-------+-------+ +--------^---------+
| default: datacenter (5% re-probe when escalated) |
v |
+---------------+ 200 + clean body +-----------+ |
| DC pool |------------------->| parse / | |
| curl_multi | | store | |
+-------+-------+ +-----------+ |
| 403 / 429 / 503 / challenge body |
v |
+---------------+ sticky session, same headers |
| RES pool |--------------------> parse / store -----------+
| curl_multi | every attempt logged: outcome, TTFB, bytes
+---------------+
Step by step:
- The router picks a tier per host from the last 200 datacenter outcomes. Under 50 samples, it probes datacenter.
- Requests run in a bounded
curl_multiwindow. Bodies are capped so one hostile response cannot eat memory. - Every attempt is classified (
ok,blocked,challenge,timeout,proxy_error,other) and written to SQLite with TTFB and bytes. - If a host’s datacenter ban rate crosses 20%, the router flips that host to residential. A 5% slice still goes to datacenter so the system notices when the block lifts.
Empirical Benchmarks & Real Comparison Data
Methodology. 10,000 requests per pool per target class, concurrency 50, identical headers and user agent in both pools, 5 s connect and 15 s total timeout, 256 KB body cap, one VPS in a single region, pools run in interleaved 1,000-request windows so time-of-day effects hit both equally. Target classes: A = unprotected pages and public APIs, B = mid-tier e-commerce behind a basic WAF with per-IP rate limits, C = heavy bot management (large retail, ticketing, social).
The ranges below are representative of what this harness produces against commodity pools from mainstream vendors. They are not a vendor ranking, and they are not measured against your target. Run the harness on your own pool before any number goes into a budget.
| Metric | Datacenter | Residential | Hybrid (DC first, escalate) |
|---|---|---|---|
| TTFB p50 (ms) | 180-350 | 900-1,800 | 250-700 (blended) |
| TTFB p95 (ms) | 600-900 | 3,000-6,000 | 1,500-3,500 |
| Throughput at c=50 (RPS) | 120-220 | 25-55 | 70-130 |
| Harness RSS (MB) | 18-24 | 18-24 | 18-24 |
| Ban + challenge rate, class A | 0.5-2% | 0.2-1% | 0.5-1% |
| Ban + challenge rate, class B | 15-40% | 3-8% | 2-6% (after retry) |
| Ban + challenge rate, class C | 70-95% | 15-35% | 10-30% (after retry) |
| Timeout rate | 0.3-1% | 2-6% | 1-3% |
| Cost per 1M successful pages, class A | $90-130 | $480-1,000 | $95-140 |
| Cost per 1M successful pages, class B | $140-220 | $480-1,000 | $220-320 |
Cost assumptions (change them to match your plan): average page of 120 KB, datacenter metered at roughly $0.80/GB, residential at roughly $4/GB. That works out to about $0.00009 per datacenter attempt and $0.00046 per residential attempt. Class B hybrid: 1M datacenter attempts (~$91) plus 30% escalated to residential (300k x $0.00046 = ~$138) lands near $230 against ~$460 for residential-only. Memory stays flat in all three columns because response bodies are capped inside the write callback.
Two things in this table tend to surprise people. First, residential only wins decisively on class B and C. On class A it is pure overhead. Second, throughput, not ban rate, is what hurts residential at scale: at c=50 you are bounded by the slowest peers in the window. Walkthroughs of this harness running live against different target classes are on the RevStack YouTube channel.
Which Proxy Type Should You Use?
Match the tier to the target and the job, not to a vendor’s homepage claims. This is the routing logic the benchmark data above supports:
| Use case | Start with | Why |
|---|---|---|
| Public APIs, docs, sitemaps, open data | Datacenter | Ban rates stay near 1%, so residential only adds latency and cost. |
| Price and stock monitoring on mid-tier retail | Datacenter, escalate per host | Most hosts tolerate datacenter until a WAF rule trips; the router catches the ones that do. |
| SERP tracking, ad and landing-page verification | Residential with geo targeting | Results and ads vary by city and ISP, and datacenter ranges are often served different content. |
| Ticketing, sneakers, social, heavy bot management | Residential plus a browser-grade client | IP reputation is necessary but not sufficient; the TLS fingerprint decides the rest. |
| Logged-in sessions, multi-account workflows | Sticky residential or static ISP proxies | Rotating exits mid-session triggers fraud checks. |
| Millions of low-value pages per day | Datacenter with a retry budget | Cost per success dominates; cap retries per URL. |
Static ISP proxies (datacenter-hosted IPs registered to consumer ISPs) sit between the two tiers on price and reputation. They are worth a test on targets where datacenter fails but residential bandwidth costs are painful. The harness below measures them the same way: add them as a third pool in pools.json.
Production-Ready Code Implementation
Plain PHP 8.1+, no Composer dependencies, one SQLite file. Save the first block as proxy_bench.php next to a pools.json that maps a pool name (datacenter, residential) to an array of proxy URLs. Use socks5h:// rather than socks5:// so DNS resolves at the proxy and does not leak from your server. Proxy URL syntax and options are documented in the libcurl CURLOPT_PROXY reference.
<?php
declare(strict_types=1);
const MAX_BODY_BYTES = 262144; // hard cap per response
const SNIFF_BYTES = 8192; // only this much is kept for block detection
const WINDOW = 1000; // interleave pools in windows of this many requests
function classify(int $errno, int $http, string $head): string
{
if ($errno === 28) { return 'timeout'; }
if ($errno !== 0 && $errno !== 23) { return 'proxy_error'; } // 23 = our own size-cap abort
if (in_array($http, [403, 429, 503], true)) { return 'blocked'; }
if ($http === 200 && preg_match('/captcha|cf-chl|access denied|unusual traffic/i', $head) === 1) {
return 'challenge';
}
return $http === 200 ? 'ok' : 'other';
}
function runPool(PDO $db, string $pool, array $proxies, string $url, int $total, int $concurrency): void
{
$host = (string) parse_url($url, PHP_URL_HOST);
$insert = $db->prepare(
'INSERT INTO samples (pool, host, outcome, http, ttfb_ms, total_ms, curl_errno, bytes, ts)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)'
);
$mh = curl_multi_init();
$inflight = [];
$launched = 0;
$launch = function () use (&$inflight, &$launched, $mh, $proxies, $url): void {
$state = new stdClass();
$state->head = '';
$state->bytes = 0;
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_PROXY => $proxies[array_rand($proxies)],
CURLOPT_CONNECTTIMEOUT_MS => 5000,
CURLOPT_TIMEOUT_MS => 15000,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 3,
CURLOPT_ENCODING => '',
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36',
CURLOPT_HTTPHEADER => ['Accept-Language: en-US,en;q=0.9'],
CURLOPT_WRITEFUNCTION => function ($ch, string $chunk) use ($state): int {
$len = strlen($chunk);
$state->bytes += $len;
if (strlen($state->head) < SNIFF_BYTES) {
$state->head .= substr($chunk, 0, SNIFF_BYTES - strlen($state->head));
}
return $state->bytes > MAX_BODY_BYTES ? 0 : $len; // returning 0 aborts the transfer
},
]);
curl_multi_add_handle($mh, $ch);
$inflight[spl_object_id($ch)] = [$ch, $state];
$launched++;
};
$db->beginTransaction();
while ($launched < min($concurrency, $total)) { $launch(); }
do {
$status = curl_multi_exec($mh, $running);
if ($status !== CURLM_OK) { break; }
$progress = false;
while (($info = curl_multi_info_read($mh)) !== false) {
$ch = $info['handle'];
$id = spl_object_id($ch);
$state = $inflight[$id][1];
$errno = (int) $info['result'];
$http = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$insert->execute([
$pool, $host, classify($errno, $http, $state->head), $http,
curl_getinfo($ch, CURLINFO_STARTTRANSFER_TIME) * 1000,
curl_getinfo($ch, CURLINFO_TOTAL_TIME) * 1000,
$errno, $state->bytes, time(),
]);
curl_multi_remove_handle($mh, $ch);
unset($inflight[$id], $ch, $state);
if ($launched < $total) { $launch(); $running++; $progress = true; }
}
if (!$progress && $running > 0 && curl_multi_select($mh, 1.0) === -1) {
usleep(2000); // select can return -1 immediately; avoid a busy loop
}
} while ($running > 0 || $inflight !== []);
$db->commit();
curl_multi_close($mh);
}
function pct(array $sorted, float $p): int
{
if ($sorted === []) { return 0; }
$i = (int) ceil($p * count($sorted)) - 1;
return (int) $sorted[max(0, min($i, count($sorted) - 1))];
}
function report(PDO $db, array $pools): void
{
foreach ($pools as $pool) {
$stmt = $db->prepare('SELECT outcome, ttfb_ms FROM samples WHERE pool = ?');
$stmt->execute([$pool]);
$n = 0; $ok = 0; $bad = 0; $lat = [];
while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {
$n++;
if ($r['outcome'] === 'ok') { $ok++; $lat[] = (float) $r['ttfb_ms']; }
if (in_array($r['outcome'], ['blocked', 'challenge'], true)) { $bad++; }
}
if ($n === 0) { continue; }
sort($lat);
printf(
'%-12s n=%d success=%.1f%% ban=%.1f%% ttfb p50=%dms p95=%dms p99=%dms' . PHP_EOL,
$pool, $n, 100 * $ok / $n, 100 * $bad / $n, pct($lat, .50), pct($lat, .95), pct($lat, .99)
);
}
}
// ---- entry point ----
$url = $argv[1] ?? '';
$total = max(WINDOW, (int) ($argv[2] ?? 10000));
if (filter_var($url, FILTER_VALIDATE_URL) === false || !str_starts_with($url, 'https://')) {
fwrite(STDERR, 'usage: php proxy_bench.php https://target.example/path [count]' . PHP_EOL);
exit(1);
}
$pools = json_decode((string) file_get_contents(__DIR__ . '/pools.json'), true, 8, JSON_THROW_ON_ERROR);
$db = new PDO('sqlite:' . __DIR__ . '/bench.sqlite', null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
$db->exec('CREATE TABLE IF NOT EXISTS samples (
id INTEGER PRIMARY KEY AUTOINCREMENT, pool TEXT, host TEXT, outcome TEXT,
http INTEGER, ttfb_ms REAL, total_ms REAL, curl_errno INTEGER, bytes INTEGER, ts INTEGER)');
$db->exec('CREATE INDEX IF NOT EXISTS idx_host_pool ON samples (host, pool, id)');
for ($done = 0; $done < $total; $done += WINDOW) {
foreach ($pools as $name => $proxies) {
runPool($db, (string) $name, $proxies, $url, WINDOW, 50);
}
}
report($db, array_keys($pools));
The router that turns those samples into a decision is small. It reads the last 200 datacenter outcomes for the host with a prepared statement and flips tiers at a 20% ban rate:
function pickTier(PDO $db, string $host): string
{
if (random_int(1, 100) <= 5) { return 'datacenter'; } // keep probing the cheap tier
$stmt = $db->prepare(<<<'SQL'
SELECT COUNT(*) AS n,
COALESCE(SUM(outcome IN ('blocked', 'challenge')), 0) AS bad
FROM (SELECT outcome FROM samples
WHERE host = :h AND pool = 'datacenter'
ORDER BY id DESC LIMIT 200)
SQL);
$stmt->execute([':h' => $host]);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$n = (int) $row['n'];
$bad = (int) $row['bad'];
if ($n < 50) { return 'datacenter'; } // not enough data, stay cheap
return ($bad / $n) > 0.20 ? 'residential' : 'datacenter';
}
Why the code looks the way it does:
CURLOPT_WRITEFUNCTIONwith a hard cap.CURLOPT_RETURNTRANSFERbuffers the entire body in PHP memory. At concurrency 50 against a hostile or misconfigured origin, that is how scrapers get OOM-killed. The callback keeps 8 KB for block detection and aborts anything over 256 KB, which is why curl error 23 is accepted inclassify().- Sliding window, not batches. A fixed batch of 50 waits for its slowest request. On residential, where p99 is several seconds, that idles most slots. The window refills one handle per completion.
- Error 28 vs. everything else. Timeouts are tracked apart from
proxy_errorbecause they point at different problems: slow exits versus dead gateways or bad credentials. Merge them and you cannot tell your vendor which one you are seeing. - Challenge detection on a 200. Many WAFs return HTTP 200 with a CAPTCHA page. Counting those as success inflates the datacenter numbers and under-triggers escalation. The regex runs on 8 KB, not the full body.
- One transaction per window. Each SQLite commit costs an fsync. Wrapping a window in a transaction turns thousands of fsyncs into one.
- Prepared statements everywhere. The host comes from a URL you were handed. Treat it as input and never interpolate it into SQL.
- Interleaved windows. Alternating pools every 1,000 requests means a mid-run block wave or ISP incident hits both tiers, so the comparison stays fair.
For the cURL mechanics, the PHP manual entry for curl_multi_exec documents the status codes and the select loop contract. If your pipeline needs a real browser fingerprint on the hard hosts, the FortiLabs Automation platform covers browser-based automation, and more system blueprints live in the Web Lab archive.
Edge Cases, Bottlenecks & Security Mitigations
Rate limiting. A 429 is an instruction, not just a failure. RFC 9110 defines Retry-After semantics (RFC 9110). Parse it per host and back off the whole host, not the single proxy. Rotating IPs to evade a per-account or per-session limit just burns bandwidth: limits keyed on IP respond to rotation, limits keyed on cookie or token do not.
Timeouts and slow exits. Keep connect timeout low (5 s) and total timeout bounded (15 s). A residential peer that connects slowly will not get faster on retry, so retry on a different exit, never the same one. Track timeout rate per pool; a sudden jump is usually vendor-side, not target-side.
TLS and HTTP fingerprinting. This is the failure that proxy tier cannot fix. libcurl’s TLS handshake produces a JA3 fingerprint that does not match mainstream browsers (JA3 reference), and bot-management products score it. If class C targets show high challenge rates on residential IPs too, the problem is your client, not your exits. Options are a curl build that impersonates browser handshakes, or a real browser behind the same proxy for those hosts only. The RevStack experiment on running multiple accounts from one PC shows how much fingerprint consistency matters in practice.
Header and geo consistency. An Accept-Language: en-US request exiting from another country is a cheap signal to flag. Match headers, locale-sensitive content, and exit geography. Keep header sets identical across pools when benchmarking, or you are measuring your headers, not the proxies.
Sticky sessions. A checkout flow or a paginated logged-in view needs one exit for the session’s lifetime. Residential gateways usually take a session ID in the username; datacenter pools need you to pin a proxy per session in your own code. Rotating mid-session is a reliable way to trigger fraud checks.
Cache poisoning. If you cache fetched pages, store only ok outcomes. A cached CAPTCHA page served to every downstream consumer is a quiet data-quality bug that looks like a parser regression. Validate against an expected marker before the cache write, and key the cache on URL, not on tier.
Click fraud and measurement contamination. If the pipeline touches ad URLs (verification, landing-page checks, creative capture), do not follow tracking redirects from a rotating pool without tagging the traffic. Unmarked bot clicks inflate invalid-traffic numbers for the advertiser and can get your ranges blocked by the network. For how click verification works on the serving side, see the ad-serving notes at AdVixo.
Monitoring. Alert on four numbers per host and tier: success rate, ban plus challenge rate, timeout rate, and cost per successful page. Page on the last one. A vendor degradation and a target-side rule change look identical in raw error counts but separate cleanly once you split by pool.
Credentials and logs. Proxy URLs contain passwords. Mask them in error output and never write them to the samples table. Restrict pools.json to the service user and keep it out of version control.
Legal and sourcing. Check the target’s terms and robots.txt, rate-limit politely, and avoid personal data. Prefer residential vendors that document how exit nodes are sourced and whether device owners opted in. Unclear sourcing is a reputational and compliance risk for your pipeline, not just the vendor’s. Providers FortiLabs has tested on camera, such as the RelayOx residential proxy review, are collected with the rest of the partner list.
Production Verdict
Default to datacenter, measure per host, and pay for residential only where the numbers justify it. On unprotected and mid-tier targets, the hybrid router cuts spend roughly in half against residential-only while keeping success within a few points of it. On heavy bot-management targets, expect both tiers to disappoint until the client fingerprint is fixed, and budget for that work before negotiating a bigger residential plan.
Ship the harness first, feed it your three worst targets, and let two days of samples set the thresholds. The 20% escalation point and the 5% re-probe rate are starting values, not constants. Targets that harden or relax will show up in your own data well before they show up in a vendor’s changelog. Hands-on tests of this kind are published on the RevStack YouTube channel, and the full engineering archive is at blog.fortilabs.dev.
Frequently Asked Questions
Are residential proxies always better than datacenter proxies?
No. Residential proxies have lower ban rates on protected sites, but they are slower and cost several times more per request. On unprotected pages and public APIs, datacenter proxies match or beat them on success rate at a fraction of the cost.
How much faster are datacenter proxies than residential proxies?
In this benchmark design, datacenter proxies return the first byte in roughly 180-350 ms at p50, against 900-1,800 ms for residential. Throughput at 50 concurrent requests is typically 120-220 RPS versus 25-55 RPS. Your numbers will vary by vendor, region and target.
What ban rate should trigger switching to residential proxies?
A 20% ban plus challenge rate over the last 200 requests per host is a sensible starting threshold. Below it, retries on datacenter are usually cheaper than residential bandwidth. Tune it with your own cost per successful page.
Why do I still get blocked on residential proxies?
Usually because of the client, not the IP. TLS fingerprints, header order, missing browser behavior and inconsistent locale all feed bot-management scoring. Test the same request through a real browser behind the same proxy to separate IP reputation from fingerprinting.
How do I benchmark proxies fairly?
Use identical headers and timeouts for every pool, run the pools in interleaved windows so incidents hit both, count CAPTCHA pages served with HTTP 200 as failures, and report cost per successful page rather than cost per request.
Is it legal to scrape with proxies?
It depends on the target’s terms, the data collected, and your jurisdiction. Respect robots.txt and rate limits, avoid personal data, and choose providers that document ethical sourcing of residential exits. Get legal advice for anything commercial or sensitive.