What is proxy concurrency?
Definition
How many requests or connections run at the same time. Often the limit you hit before bandwidth, and the setting that decides when a target pushes back.
Throughput is set by two numbers, not one. Little’s law, from queueing theory, says the average number of jobs in a stable system equals their arrival rate times the average time each one spends inside. Rearranged for a scraper, responses per second equal concurrency divided by average response time. A worked example with assumed numbers: 20 workers waiting half a second per response top out at 40 responses a second, and halving the latency doubles that with the same 20 workers. That is arithmetic, not a measurement, and it is why a cheap plan with a low concurrency cap can finish later than an expensive one at the same price per gigabyte.
Three ceilings, and the lowest one wins
Your effective concurrency is the smallest of three limits: what your client library allows, what your proxy plan allows, and what the target tolerates before it pushes back. The first is the one people forget, because it is set before you write a line of configuration.
| Client | Default limit | What happens past it |
|---|---|---|
| httpx | max_connections 100, of which 20 kept alive |
Requests wait for a free connection, then raise PoolTimeout if none frees up in time |
aiohttp TCPConnector |
limit 100 in total, limit_per_host 0, meaning no per-host cap |
Requests wait for a free connection |
requests HTTPAdapter |
pool_maxsize 10, pool_block False |
Extra connections are opened and thrown away after use; urllib3 logs “Connection pool is full, discarding connection” |
Node.js http.Agent |
maxSockets Infinity per origin |
Nothing stops you |
curl --parallel |
--parallel-max 50 |
Further transfers wait |
The requests row matters more through a proxy than direct. Every discarded connection is a new tunnel, and on a rotating gateway the exit is chosen when a CONNECT tunnel opens, so a kept-alive connection keeps its exit for every request it carries while a fresh one may land somewhere else. Twenty threads on a pool of ten do not just cost handshakes. They change how often your address changes.
Set the ceiling in your own code
Relying on the provider to enforce the limit means discovering it through failures. Choose the number yourself. This version uses only the Python standard library, so it runs as written; we ran it on Python 3.15.0 through a local test proxy, where it printed Counter({'200': 40}).
import sys
import urllib.request
from collections import Counter
from concurrent.futures import ThreadPoolExecutor
PROXY = sys.argv[1] if len(sys.argv) > 1 else "http://user:pass@gw.example.net:8000"
CEILING = 8 # your number, not the plan's maximum
opener = urllib.request.build_opener(
urllib.request.ProxyHandler({"http": PROXY, "https": PROXY}))
def fetch(url: str) -> str:
try:
with opener.open(url, timeout=30) as r:
return str(r.status)
except urllib.error.HTTPError as e:
return str(e.code)
except Exception as e:
return type(e).__name__
urls = ["https://example.com/"] * 40
with ThreadPoolExecutor(max_workers=CEILING) as pool:
print(Counter(pool.map(fetch, urls)))
Counting outcomes rather than printing them is deliberate. When the ceiling is too high, the counter is where it shows first.
Finding the right number
Raise the ceiling in steps and watch the success rate, measured on content rather than status codes, not the throughput. Throughput keeps climbing for a while after results start to degrade, because blocked responses are fast. The right setting is the highest one at which the success rate has not yet fallen.
When it does fall, the symptom tells you which ceiling you hit. A plan limit shows up as connections refused or queued at the gateway. A target’s rate limiter answers 429, which RFC 6585 says may carry a Retry-After header telling you how long to wait. A bot defence answers with challenges or 403s and no explanation. And your own machine runs out of sockets or memory, producing timeouts that look exactly like remote blocking. Rule that one out first, because it costs nothing to check.
The Python proxy guide covers connection reuse and retries in requests, httpx and aiohttp, the Node.js guide shows how reusing one agent decides how many tunnels you open, and the 403 vs 407 vs 429 guide covers backing off from a 429 without every worker retrying at the same moment.
Frequently asked questions
How many concurrent requests should I use?
Does a plan's concurrency limit count connections or requests?
Sources
- Little, J. D. C. (1961). A Proof for the Queuing Formula: L = λW. Operations Research 9(3)
- HTTPX documentation: resource limits and their defaults
- HTTPX documentation: the pool timeout and PoolTimeout
- aiohttp client reference: TCPConnector limit and limit_per_host
- Requests API: HTTPAdapter pool_connections, pool_maxsize, pool_block
- urllib3 source: the 'Connection pool is full, discarding connection' warning
- Node.js documentation: http.Agent maxSockets
- curl manual: --parallel and --parallel-max
- RFC 6585: status 429 Too Many Requests and Retry-After