Site AI AuditInternet Solutions द्वारा

Rate Limiting Explained: Slow Down Attackers and Bad Bots

25 अक्तूबर 20268 मिनट पढ़ेंसुरक्षा और SSL
Rate Limiting Explained: Slow Down Attackers and Bad Bots

Short answer: Rate limiting means setting a ceiling on how many requests one visitor, address or account may make within a period of time. Real people stay far below the ceiling, while password-guessing scripts, scrapers and flooding tools hit it quickly and get slowed or blocked. It does not replace other defences, but it is one of the cheapest ways to protect login pages, forms and search from abuse.

What rate limiting does

Every visit to your website is a request. A person reading a page sends a handful of requests in a few seconds: the page itself, then images, styles and scripts. A script that tries thousands of passwords or copies your whole catalogue sends far more, and it does so repeatedly. Rate limiting counts requests per visitor over a short window and acts when the count goes above a threshold you chose.

The action can be mild or strict. The server can delay the response, show a challenge such as a verification step, return an error that tells the client to wait, or block the visitor for a period. The idea is to make abuse slow and costly while leaving ordinary use untouched.

Where rate limiting helps most

You do not need to limit everything. Focus on the places that attackers and bad scripts like to hit, because they are expensive for your server or valuable to an attacker.

How to choose a limit

A limit that is too loose does nothing. One that is too strict blocks real customers, which is worse than the problem you are solving. Start from real behaviour instead of guessing.

Look at your access logs for a normal busy day and note how many requests a typical visitor makes to the endpoint in question. For a login page, a person rarely needs more than a few attempts in a minute, so something like five failed attempts in several minutes is generous for a human and painful for a script. For whole-site limits, remember that one page view can produce dozens of requests for images and scripts, so count page requests or use a much higher ceiling. Our guide to reading access logs shows how to find the numbers.

Then start gently. Many tools let you run a rule in a log-only mode first, which shows what would have been blocked without blocking anyone. Review the list, adjust, and only then switch to enforcement.

What counts as one visitor

Rate limiting needs a way to tell visitors apart. The usual key is the IP address, but that is imperfect. Many people share one address, for example everyone in an office, a school or behind a mobile network. A strict per-address limit can block them all because of one busy user. On the other hand, attackers can spread requests across thousands of addresses, so each address stays under the ceiling.

To handle both cases, combine keys where you can. Limit by address for coarse protection, and limit by account name or email for sensitive forms, so that guessing one account’s password from many addresses still triggers a limit. This is the pattern used against stolen password lists, described in our article on credential stuffing.

If your site sits behind a proxy or content delivery network, make sure the limit uses the visitor’s real address and not the address of the proxy. Otherwise every visitor looks the same and the first person to trigger the rule blocks everybody. Your provider’s documentation usually names the header that carries the original address.

How the server should answer

The standard way to tell a client it is going too fast is the HTTP status 429, which means too many requests. A good response also includes a header called Retry-After that says how many seconds to wait. Well-behaved clients, including search engine crawlers, slow down when they see this. Badly behaved ones ignore it, which is when blocking becomes necessary.

For people, show a short message in plain words, such as “Too many attempts, please try again in a few minutes”. Avoid messages that reveal details, for example whether an account exists. For login pages the message should be identical whether the username is right or wrong.

Be careful with search engines. Blocking a legitimate crawler with a very low limit can slow down how quickly your new pages are discovered. If your server struggles with crawler traffic, a 429 or 503 response with a Retry-After header is the polite way to ask for a slower pace. Our article on slow websites during traffic spikes looks at the wider problem.

Where to set it up

There are several layers, and they can be combined.

For most small sites, a managed firewall or the host’s built-in protection plus a login-limiting plugin is a sensible and low-effort combination.

Limits of rate limiting

Rate limiting is not a complete defence. A distributed attack that spreads requests across many addresses can stay under every per-address limit. A flood large enough to fill your network connection has to be stopped upstream by a provider, as discussed in our guide to DDoS protection for small websites. Slow, patient guessing that stays under the ceiling is still possible, which is why strong passwords and two-factor login matter alongside limits.

It can also cause harm if configured badly. Blocking an address for a long time after a few mistakes can lock out a customer who simply forgot their password, or lock out you when you are travelling. Prefer short, temporary blocks that grow if the behaviour continues, and make sure you have a way to unblock yourself, such as access through your hosting panel.

A simple starting plan

  1. Pick the three most abused places on your site, usually login, password reset and a form.
  2. Check your logs to see what normal use looks like.
  3. Add a limit for each place, in log-only mode if the tool allows it.
  4. Review the blocked entries after a week and adjust any that hit real users.
  5. Switch to enforcement, and keep a note of how to unblock an address.
  6. Review the rules every few months, because traffic and attackers change.

How Site AI Audit helps

Site AI Audit checks the visible basics of your website’s security: the SSL certificate, the redirect from HTTP to HTTPS, security headers and exposed software versions. It does not test rate limits or try to attack your login page, so use your hosting panel or firewall service to check those. You can run a free check of your website or see the plans.

Related reading

The bottom line

Rate limiting is a cheap and effective way to make abuse slow while keeping normal use smooth. Protect the login, reset and form pages first, base your limits on real traffic, answer with a clear 429 message and keep temporary blocks short. Combine it with strong passwords, two-factor login and a firewall, and review the rules from time to time.

FAQ

What is a good rate limit for a login page?

There is no universal number. A common approach is to allow a few failed attempts within several minutes per address and per account, then slow down or block temporarily. Check your logs and adjust.

Will rate limiting hurt my search rankings?

Not if it is set sensibly. Do not block legitimate crawlers with very low limits. If you need them to slow down, a 429 or 503 response with a Retry-After header is the polite way.

Can I rate limit on shared hosting?

Often through a security plugin for login attempts, or through a firewall service placed in front of your site. Server-level rules may not be available, so ask your host what they offer.

Does rate limiting stop DDoS attacks?

Only small ones. Large floods must be absorbed upstream by a network or protection provider, because they can overload your connection before your rules run.

Why do real visitors get blocked?

Usually because many people share one address, or because the limit is too low for pages that trigger many requests. Raise the limit, count page requests rather than all files, or add an account-based key.

#Web hosting#Web vulnerabilities#Website security
अपनी वेबसाइट जाँचें — मुफ़्त।आपकी वेबसाइट में क्या ठीक करना है — और शुरुआत कहाँ से करें।
मुफ़्त शुरू करें

ब्लॉग से और

सभी लेख →
Internet Solutions

हमारी टीम के और प्रोडक्ट

Internet Solutions द्वारा बनाए गए। हमारे बाकी प्रोडक्ट भी आज़माएँ — हर एक अलग तरीके से आपका समय बचाता है।

internet-solutions.net ↗
01सोशल मीडिया ऑटो-पोस्टिंग
PostRSS

आपकी RSS फ़ीड की नई पोस्ट अपने-आप Facebook, X, LinkedIn, Telegram और 60+ अन्य नेटवर्क पर पहुँच जाती हैं।

मुफ़्त प्लान · 2014 सेदेखें →
02वेबसाइटों के लिए AI लाइव चैट
Talkmio

आपकी वेबसाइट आपके अपने कंटेंट से, विज़िटर की भाषा में, 24/7 जवाब देती है।

मुफ़्त प्लान · कार्ड की ज़रूरत नहींदेखें →
03AI असिस्टेंट
Ask Mio

चैट, कोड, डिज़ाइन, लेखन और रिसर्च। Mio हर काम के लिए सबसे अच्छा मॉडल चुनता है।

मुफ़्त प्लानदेखें →
04ब्लॉग और सोशल मीडिया के लिए AI ऑटोपायलट
AI Blog Autopilot

AI 2,000–3,000 शब्दों के SEO लेख लिखता है और हर लेख को 60 सोशल नेटवर्क पर शेयर करता है।

पहले 3 लेख मुफ़्तदेखें →
05गहन SEO क्रॉल
Site SEO AI Audit

7 क्षेत्रों में पूरा SEO क्रॉल, AI सर्च में दृश्यता सहित, असर के हिसाब से क्रमबद्ध सुधारों के साथ।

पहला ऑडिट मुफ़्तदेखें →
06RSS और प्रोडक्ट फ़ीड
RSS Feed Creator

किसी भी वेब पेज से RSS बनाएँ, साथ ही Google और Meta के लिए अपने-आप अपडेट होने वाली प्रोडक्ट फ़ीड।

मुफ़्त प्लानदेखें →
07वेब डेवलपमेंट और SEO
Internet Solutions

वेबसाइटें, ई-शॉप और कस्टम सिस्टम — हमारी टीम डिज़ाइन करती है, बनाती है और चलाती है।

2011 सेदेखें →