ThisCalculator

Everyday

Stop Crawlers Burning Free Database Hours

Updated · Standard formula, shown below

Hours consumed per month 0.14 hours
Percentage of free quota
0.0 %
Result
Crawler requests per hour
1000 requests
You entered
Database hours per month
750 hours
You entered

This guide explains how to stop web crawlers from exhausting your free database hours, whether you use a cloud platform like Oracle Cloud Free Tier, a serverless database, or a shared hosting plan. You’ll learn the practical steps—rate limiting, bot filtering, connection controls, and monitoring—that keep automated traffic from draining your quota, and you’ll get clear instructions you can apply immediately.

Formula

The calculator estimates how many database hours crawlers consume based on request volume and query duration. The formula is:

Hours consumed = (requests per hour × average query time in seconds) / 3600

Then, to see how much of your free quota that represents:

Percentage of quota = (hours consumed / monthly free hours) × 100

  • t – crawler requests per hour (requests/hour)
  • r – average time each request spends executing a database query (seconds)
  • d – your total free database hours per month (hours)

The result shows how many hours of database usage crawlers consume and what fraction of your free tier that represents. For example, if a crawler sends 1,000 requests per hour, each taking 0.5 seconds, that’s 500 seconds of database time per hour, or about 0.139 hours per hour—over a month (720 hours) that’s roughly 100 hours, which is about 13% of a typical 750-hour free quota.

Worked Example

Using the default values from the calculator above:

  1. Requests per hour = 1,000
  2. Average query time = 0.5 seconds
  3. Total database seconds per hour = 1,000 × 0.5 = 500 seconds
  4. Convert to hours: 500 / 3600 = 0.1389 hours per hour
  5. Monthly consumption = 0.1389 × 720 hours = 100 hours
  6. Percentage of free quota = (100 / 750) × 100 = 13.3%

So 1,000 requests per hour, each taking half a second, consumes about 100 hours of a 750-hour free tier—13.3% of your monthly allowance. That’s significant if you have other traffic, and it shows why even modest crawler activity can burn through free hours quickly.

Background: Why Crawlers Eat Database Hours

Web crawlers—automated bots that scan your site—can generate thousands of requests per hour. Each request may trigger a database query: checking a user, fetching a post, or logging a visit. On free tiers, you’re allocated a fixed number of compute hours per month (e.g., 750 hours on Oracle Cloud Free Tier, or a set number of read/write operations on serverless databases like DynamoDB or Firebase). Crawlers don’t respect your quota; they just follow links and hit endpoints. The problem is worse for sites with many pages, because crawlers like Googlebot and Bingbot try to index everything, and less scrupulous bots (scrapers, SEO tools, or malicious scanners) can be even more aggressive.

Free tiers are designed for light development or low-traffic projects. A single crawler hitting your site 24/7 can easily triple your database usage, leading to throttling or charges if you exceed the free limit. The key is to filter and limit bot traffic before it reaches your database.

How to Identify Which Crawlers Are Hitting Your Database

Before you block anything, you need to know what’s coming in. Most hosting platforms and database services provide logs. Check your web server access logs (Apache, Nginx) or your cloud provider’s monitoring dashboard. Look for patterns:

  • Repeated requests from the same IP address or user-agent string
  • Requests to URLs that don’t exist (404s) from bots probing for vulnerabilities
  • High request rates from known bot user agents like Googlebot, Bingbot, or AhrefsBot
  • Unusual patterns like requests to admin pages or API endpoints without authentication

Once you see the traffic, you can decide which bots to block or throttle. Legitimate search engine crawlers (Google, Bing) are usually worth allowing, but you can control their crawl rate via robots.txt and webmaster tools. Other bots—like scrapers or SEO tools—can be blocked entirely.

Blocking Bots at the Server Level

The most effective way to stop crawlers from hitting your database is to block them before they reach your application. Here are the common methods, in order of preference:

  1. Update robots.txt: This is the politest method. It tells well-behaved crawlers which paths to avoid. Add rules like Disallow: /api/ or Disallow: /search?* to prevent indexing of resource-heavy pages. However, malicious bots ignore robots.txt, so this alone isn’t enough.
  2. Configure your web server (Nginx or Apache): Use if blocks or modules to deny requests from known bot user agents or IP ranges. For example, in Nginx you can return a 403 for any request with a user-agent containing “bot” or “crawler” (except allowlisted ones). This stops the request before any database query.
  3. Use a firewall or CDN: Services like Cloudflare offer bot management features that can block or challenge suspicious traffic. You can create firewall rules to block countries, IP ranges, or user agents. This offloads the filtering and reduces server load.
  4. Implement rate limiting at the application level: If you can’t block bots entirely, limit how many requests each IP can make per minute. Use middleware like express-rate-limit (Node.js) or django-ratelimit (Python) to return a 429 status after a threshold. This prevents a single crawler from overwhelming your database.

Remember to allowlist legitimate search engine bots if you want SEO to work. You can do this by checking the IP address against Google’s published bot IP ranges, or by using reverse DNS lookup to verify the bot’s identity.

Database-Level Controls and Connection Management

Even with server-level filtering, some bots will slip through. To protect your database directly:

  • Set connection limits: Most databases allow you to cap the number of concurrent connections. On PostgreSQL, set max_connections; on MySQL, max_connections. This prevents a flood of requests from opening too many connections and exhausting resources.
  • Use connection pooling: Tools like PgBouncer or ProxySQL manage a small pool of database connections and reuse them, reducing overhead and preventing connection exhaustion.
  • Enable read-only replicas for heavy traffic: If crawlers are hammering read queries, route them to a read replica so your primary database isn’t affected. This is common on cloud platforms but may cost extra on free tiers.
  • Implement caching: Use Redis or Memcached to cache database query results for frequently accessed pages. If a crawler requests the same URL repeatedly, the cache serves the response without hitting the database. This drastically reduces database load.

Also, consider adding a database proxy that can throttle or reject requests when usage exceeds a threshold. Some cloud providers offer this natively; otherwise, you can build a simple middleware that tracks request counts and returns an error if the limit is hit.

Monitoring and Alerting to Catch Crawler Spikes

You can’t fix what you don’t see. Set up monitoring on your database usage and web traffic:

  • Cloud provider metrics: Oracle Cloud, AWS, and others show database CPU, I/O, and connection counts. Set up alerts to notify you when usage exceeds a certain percentage of your free quota.
  • Web analytics: Tools like Google Analytics or self-hosted Matomo can show you bot traffic, but they often miss non-JavaScript bots. Better to rely on server logs.
  • Log analysis: Use a tool like GoAccess or ELK stack to parse server logs and identify top IPs and user agents. Schedule a daily report to see trends.

When you spot a spike, you can act quickly—block the offending IP or user agent, or update your rate limits. Without monitoring, you might only notice when your database is throttled or you receive a bill.

Common Mistakes and Misconceptions

One common mistake is relying solely on robots.txt. It only works for compliant bots; scrapers and malicious crawlers ignore it. Another is blocking all bots indiscriminately, which can hurt your SEO if you block Googlebot. Always verify that a bot is legitimate before blocking it.

A misconception is that free database hours are only consumed by active queries. In some platforms, even idle connections or background processes count toward usage. So closing connections properly and using connection pooling can save hours even without reducing request volume.

Another error is forgetting about API endpoints. Crawlers often target /api/ paths because they return JSON data. Make sure your robots.txt disallows these, and add authentication or rate limiting to APIs.

Comparing Free Tier Limits Across Providers

Different providers have different definitions of “free database hours.” Oracle Cloud Free Tier gives you 750 hours of compute per month across two AMD-based VMs, which includes database services like Autonomous Database. AWS Free Tier includes 750 hours of RDS (MySQL, PostgreSQL, etc.) per month for 12 months, but only for certain instance types. Google Cloud’s free tier includes a limited number of queries per day for BigQuery, but not a traditional relational database. Serverless options like Firebase or Supabase offer free tiers based on operations (reads/writes) rather than compute hours. Knowing your provider’s exact metering is crucial—for example, Oracle counts every hour the database is running, even if idle, while serverless counts only active operations. This affects your mitigation strategy: for Oracle, you might shut down the database during off-hours; for serverless, you focus on reducing request volume.

Costs and Safety Considerations

If you exceed your free tier, you’ll either be throttled or charged. Throttling means your site becomes slow or unavailable, which can harm user experience. Charges can be significant if a crawler runs wild for days. To avoid surprises, set up billing alerts on your cloud account. Many providers allow you to set a spending limit, though some don’t for free tiers. Always keep backups of your database before making significant changes like blocking IP ranges, in case you accidentally block legitimate users. Also, be careful when using IP blocking—some bots use distributed IPs, so blocking one may not stop them. Use a combination of methods for best results.

Frequently Asked Questions

Does robots.txt stop all crawlers?

No. robots.txt is a voluntary protocol. Well-behaved crawlers like Googlebot and Bingbot will respect it, but many scrapers and malicious bots ignore it entirely. Use it as a first step, but combine it with server-level blocking and rate limiting for real protection.

How do I know if a bot is legitimate?

Check the user-agent string and reverse DNS. For example, Googlebot’s IPs resolve to googlebot.com. You can also verify via the provider’s published bot IP ranges. If you’re unsure, block it temporarily and see if your search rankings drop—but that’s risky. Better to allowlist known good bots and block everything else.

Will blocking bots affect my SEO?

If you block legitimate search engine bots, yes. But you can block only the bots that are causing problems while allowing Googlebot and Bingbot. Use robots.txt to disallow specific paths that are resource-heavy, and use server-level rules to block unknown bots.

What is the best way to rate limit crawlers?

At the application level, use a library that tracks IP addresses and limits requests per minute. For example, in Node.js use express-rate-limit; in Django use django-ratelimit. Set a threshold like 100 requests per minute per IP, and return a 429 status with a retry-after header. This is more flexible than server-level blocking because you can allow higher limits for authenticated users.

Can caching completely solve the problem?

Caching can dramatically reduce database load, but it doesn’t eliminate it. If a crawler requests a URL that isn’t cached (e.g., a search query with unique parameters), it will still hit the database. Use caching for static content and common queries, but combine it with rate limiting to handle uncached requests.

What if my database is still burning hours after these steps?

You may need to upgrade to a paid tier or optimize your queries. Check if your database is running 24/7—on some platforms you can stop it during off-peak hours. Also, review your application code for N+1 queries or missing indexes that make each request slower. Use a database profiler to find slow queries and optimize them.

Related

Formula used
in t | Crawler requests per hour | requests | 1000 | 0
in d | Database hours per month | hours | 750 | 0
in r | Average query time | seconds | 0.5 | 0
out h | Hours consumed per month | hours | (t * r) / 3600 | 2
out p | Percentage of free quota | % | ((t * r) / 3600) / d * 100 | 1

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.