Request rate is the number of requests a scraper sends to a target site in a given time. The right rate lets you collect data without slowing the site down. This limit applies to the domain, not to the IP. A scraper that sends one request per second from a hundred IPs is a hundred requests per second to the server. This post covers a per-domain rate limit, slowing down based on server signals and cutting requests you do not need.
A proxy does not spread the load
A proxy changes the address a request leaves from. It does not change the work the server does. Every page request costs the target the same database query, the same template rendering and the same bandwidth. Which IP sent the request has no effect on that cost.
A site's rate limit is not always tied to the IP either. RFC 6585 defines the 429 code and leaves it to the server how it counts requests. The count can be per resource, across the whole server, or by cookie and account. Changing IPs does not lift that limit. Trying to lift it means ignoring a rule the site has set openly.
A proxy has a different, legitimate job: seeing a price that varies by country from that country, or keeping your own office IP apart from the work. Rotating Proxy gives you a different exit IP on every request. The rate setting still lives in your code, per domain.
A limit per domain
Two settings decide the rate: concurrency and interval. Concurrency is the number of requests open to the same site at the same time. The interval is the time between two requests. If you do not hold both, one cancels out the other.
Total concurrency can be high. A job that crawls fifty different sites at once, with one connection to each, strains none of them. The problem starts when every worker heads for the same domain. So each domain gets its own limiter, and all workers going to that domain share it.
There are two common models for the interval. A token bucket collects tokens at a set rate and allows a short burst when the bucket is full. In the fixed-interval model, each request leaves a set time after the previous one. To spare the server, the second is simpler, because there is no burst. We covered the difference between the algorithms in our 429 Too Many Requests post.
Add a small random extra to the interval (jitter), for example 0-30%. The extra only lengthens the interval and never shortens it. The goal is not to fool the server. It is to stop all workers from waking up together after a pause and firing in the same second. One request per second and two concurrent connections are a cautious starting point. Move the rate up or down based on how the server responds.
robots.txt and bot identity
robots.txt says which paths you may enter. It does not say how fast. RFC 9309 defines only the user-agent, allow and disallow records. Crawl-delay is not part of the standard. The standard says crawlers may interpret records it does not define and gives the Sitemap line as an example.
In practice the picture is mixed. Google states plainly in its documentation that it does not support the Crawl-delay line. Bing, in older webmaster notes, described reading the line as a time window. For a scraper the rule is simple. If the line is there, it is the site owner's rate preference: when you see Crawl-delay: 5, do not drop the interval below 5 seconds. In Python, the crawl_delay() method of the urllib.robotparser module returns that value. We walked through how the rules are read in our What Is a robots.txt File post.
Bot identity is part of being polite too. Put the bot's name and the address of a page that describes it in the User-Agent value: ExamplePriceBot/1.0 (+https://example.com/bot). RFC 9110 goes one step further. It recommends that automated clients send an email address in the From header so they can be reached when problems occur. If a site admin can write to you, they may ask you to slow down instead of blocking you.
Server signals
A server says it is struggling in a few ways, and the answer to every signal is to slow down. Speeding up, retrying more often or switching IPs and carrying on makes the problem bigger. The table below lists the signals and the right response.
| Signal | Meaning | What to do |
|---|---|---|
429 Too Many Requests | The limit set for this client was exceeded | Pause the domain for Retry-After, halve the rate |
503 Service Unavailable | The server is temporarily overloaded or in maintenance | Same response; exponential backoff if the header is missing |
Retry-After header | How long to wait: seconds or an HTTP date | Read both formats; if the wait is very long, defer the job |
| Response time grows | The server is struggling, no error yet | Lower the rate before errors arrive |
| Connection refused, timeout | The server may not even manage a 503 | Space out retries, stop if needed |
403 or an unexpected page | Access denied | Stop and look into the cause; do not try to get around it |
Two rows are easy to miss. The first is response time. If a page that normally returns in under a second starts taking several seconds, the server has begun queuing requests. Slowing down before an error code arrives is the most polite response. The second is a refused connection. RFC 9110 does not promise that every overloaded server returns 503. Some simply refuse the connection.
An adaptive rate handles these signals automatically. The rule resembles TCP congestion control: the rate rises a little on every successful response and halves on every bad signal. It climbs slowly and drops fast. That way the limiter settles just below the rate the server can handle at that moment.
A rate limiter in Python
The example below puts these rules in one file. Each domain gets its own DomainLimiter object. The object holds concurrency with a semaphore and the interval with a schedule. When 429 or 503 arrives, it pauses every task for that domain for Retry-After.
import asyncio
import random
import time
from email.utils import parsedate_to_datetime
from urllib.parse import urlsplit
import httpx
PROXY = "http://user:pass@pr.proxynet.io:8000"
MAX_WAIT = 600 # if Retry-After is longer than this, leave the URL for later
class DomainLimiter:
"""For one domain: concurrency limit, interval + jitter, adaptive rate."""
def __init__(self, rate=1.0, concurrency=2, min_rate=0.1, max_rate=2.0):
self.rate = rate # requests per second
self.min_rate, self.max_rate = min_rate, max_rate
self.sem = asyncio.Semaphore(concurrency)
self.lock = asyncio.Lock()
self.next_at = 0.0
self.paused_until = 0.0
self.avg = None # average response time
async def acquire(self):
while True:
async with self.lock:
now = time.monotonic()
start = max(now, self.next_at, self.paused_until)
self.next_at = start + random.uniform(1.0, 1.3) / self.rate
await asyncio.sleep(start - now)
if time.monotonic() >= self.paused_until:
return # a pause arrived while waiting: get back in line
def pause(self, seconds):
self.paused_until = max(self.paused_until, time.monotonic() + seconds)
self.rate = max(self.min_rate, self.rate / 2)
def observe(self, seconds):
if self.avg is not None and seconds > 3 * self.avg:
self.rate = max(self.min_rate, self.rate / 2) # the server slowed down
else:
self.rate = min(self.max_rate, self.rate + 0.05)
self.avg = seconds if self.avg is None else 0.8 * self.avg + 0.2 * seconds
def retry_after(value, default):
if not value:
return default
if value.strip().isdigit():
return int(value)
try: # HTTP date format
return max(0.0, parsedate_to_datetime(value).timestamp() - time.time())
except (TypeError, ValueError):
return default
async def fetch(client, limiters, url, tries=4):
lim = limiters.setdefault(urlsplit(url).hostname, DomainLimiter())
for attempt in range(tries):
async with lim.sem:
await lim.acquire()
t0 = time.monotonic()
r = await client.get(url)
if r.status_code not in (429, 503):
lim.observe(time.monotonic() - t0)
return r
wait = retry_after(r.headers.get("Retry-After"), 5 * 2**attempt)
if wait > MAX_WAIT:
return r # give up for today, add it to the queue later
lim.pause(wait) # every task for this domain waits
return r
async def main(urls):
headers = {
"User-Agent": "ExamplePriceBot/1.0 (+https://example.com/bot)",
"From": "bot@example.com",
}
limiters = {}
async with httpx.AsyncClient(proxy=PROXY, headers=headers, timeout=20) as client:
responses = await asyncio.gather(*(fetch(client, limiters, u) for u in urls))
for url, r in zip(urls, responses):
print(r.status_code, url)
if __name__ == "__main__":
asyncio.run(main([f"https://example.com/product/{i}" for i in range(1, 11)]))Three lines carry the logic. After waking, acquire() checks whether a pause has arrived. Without that check, workers that queued before the pause would send requests in the middle of the Retry-After window. pause() applies the wait per domain, not per request. And MAX_WAIT keeps a one-hour Retry-After from holding the script for an hour; it leaves that URL for the next run.
If robots.txt has a Crawl-delay, build the limiter with DomainLimiter(rate=1 / delay, min_rate=min(0.1, 1 / delay), max_rate=1 / delay). Jitter only lengthens the interval, and with min_rate capped at the same value the adaptive rate never drops below the interval the site owner asked for, even for delays longer than 10 seconds.
Fewer requests, the right hour
The most polite request is the one you never send. In recurring jobs such as price or stock tracking, most pages do not change between two runs. Conditional requests in RFC 9110 exist for exactly this. The server sends an ETag or Last-Modified value in the first response. On the next request you send that value back in the If-None-Match or If-Modified-Since header. If the page has not changed, the server returns a 304 Not Modified with no body.
etags = {} # url -> ETag; in real use keep it on disk or in a database
async def fetch_if_changed(client, url):
headers = {"If-None-Match": etags[url]} if url in etags else {}
r = await client.get(url, headers=headers)
if r.status_code == 304:
return None # page unchanged, no body came back
if "ETag" in r.headers:
etags[url] = r.headers["ETag"]
return r.textNot every server sends these headers. If it does not, cut the load on your side. Do not download the same URL twice in one run, and check the lastmod date in the sitemap so you queue only the addresses that changed. If you store the raw HTML, fixing a parser bug does not require crawling the site again.
The time of day matters too. Run bulk pulls during the night hours of the time zone where the site's visitors live. For an e-commerce site in Türkiye, that means after midnight Türkiye time. If response times grow during the day, the adaptive rate catches it anyway. But placing a large first crawl outside peak hours from the start is the cleaner path. For jobs that collect prices by location, Residential Proxy lets you exit from the target country; the timing and rate rules still apply.
How we tested
We ran the examples on December 1, 2026, on Windows 11 with Python 3.13 and HTTPX 0.28.1. We set up two local test servers, 127.0.0.1 and 127.0.0.2. The servers logged the time of every incoming request and the number of requests open at that moment. The first server returned 429 with Retry-After: 3 on the sixth request and delayed the ninth and tenth requests by 1.5 seconds.
In our test, no domain ever received more than two requests at once. The two domains did not wait on each other, and at least one second passed between requests. After the 429, the first domain got no requests at all for three seconds. After the slow responses, the gap between requests widened. We also set up a local HTTP proxy that requires user:pass. In this test fetch() and the ETag example ran through the proxy: on the second pull the server returned 304 and no body came back. Retry-After was read correctly in both the seconds and the HTTP date format.
The bottom line
Keep the rate limit per domain, stop every task for that domain when Retry-After arrives, and do not download unchanged pages. Above all, do not mistake proxy count for a rate setting: more IPs mean more load on the site. A proxy spreads addresses, not good manners.
Sources
- RFC 9309, Robots Exclusion Protocol: rfc-editor.org
- RFC 9110, HTTP Semantics, §10.2.3 Retry-After: rfc-editor.org
- RFC 6585, §4 429 Too Many Requests: datatracker.ietf.org
- How Google interprets robots.txt, supported fields: developers.google.com
- Python documentation, urllib.robotparser: docs.python.org
Frequently asked questions
How many requests per second should I send when scraping?
There is no single right number. If robots.txt has a Crawl-delay, the interval should be at least that long. If not, one request per second and two concurrent connections are a cautious start. Then tune the rate to the server's responses: raise it slowly while responses come back fast and error-free, and halve it when you see 429, 503 or growing response times.
Does using a proxy make the rate limit irrelevant?
No. A proxy changes the address a request leaves from, not the work the server spends on it. Many sites count requests by account, cookie or across the whole server, not by IP. Trying to get past the limit by changing IPs both ignores the site's rule and strains the server. Keep the rate limit per domain in your own code, independent of how many proxies you use.
Is Crawl-delay a standard?
No. RFC 9309 defines only the user-agent, allow and disallow records, and Crawl-delay is not part of that standard. Google does not support the line. Some search engine bots do read it. Even outside the standard, the line is a rate preference the site owner wrote down openly. For a scraper, the right reading is to treat the value as the shortest interval between requests.
How long should I wait if there is no Retry-After header?
Use exponential backoff. Wait a few seconds on the first retry, double the wait on every new error and set an upper limit. Add a small random offset to the wait so all workers do not wake up together. If you still get 429 or 503 after a few attempts, drop the URL for the day and add it to the next run.
Why is jitter needed?
Jitter keeps concurrent workers from waking up at the same moment. If every worker waits the same time after a pause, they all send in the same second. That is a sudden wave against a server that was just struggling. Adding a random 0-30% to the interval spreads requests over time. The goal is not to fool the server but to keep the load flat.
What should I put in the User-Agent?
Your bot's name, its version and the address of a page that describes it: ExamplePriceBot/1.0 (+https://example.com/bot). Do not use a value that imitates a browser. RFC 9110 also recommends that automated clients send a reachable email address in the From header. When a site admin sees a problem, they can write to you instead of blocking you. We explained how a User-Agent is built in our What Is a User Agent post.




