Tom has spent some time lately doing what was supposed to be fairly routine server work for one of our clients, who runs a handful of photo archive websites (the kind of lovely, image-heavy heritage sites where you can lose an entire afternoon looking at old pictures of your own street).
Update the servers, move a couple of sites onto newer hosting, tidy up, done. But once he started digging into the traffic logs, it turned into something else entirely… and he’s now, in his own words, “a little obsessed” with the client’s database bill.
Because it turns out the vast majority of the visitors to these sites weren’t people at all. They were bots – and the busiest one of all was calling itself ClaudeBot (yes, as in Claude, the AI we use every day… more on the irony of that later). So this is the story of how we found them, why we didn’t just block them all, and how sorting it out cut the client’s database costs in half.
If you’re short on time, here’s the gist:
- More than 80% of the traffic to one archive site was bots and crawlers, not people
- They were hammering the search pages, which are the most expensive pages on the site to run
- We made the search code more efficient, then used Cloudflare to slow the bots down rather than block them outright
- That let us halve the size of the database server, saving roughly £1,900 a year on that site alone
How much of your website traffic is actually bots?
Probably a lot more than you think. When Tom looked at the biggest of the archive sites, it had received around 4.5 million requests in a month, and 82.5% of those came from visitors that openly identified themselves as bots or crawlers (crawlers are basically automated programs that wander around the web reading pages, for search engines, AI companies, SEO tools and so on). ClaudeBot alone accounted for 1.1 million of them!
| What we measured | Figure |
|---|---|
| Total requests in a month | ~4.5 million |
| Share from self-identified bots and crawlers | 82.5% |
| Requests from ClaudeBot alone | ~1.1 million |
And that 82.5% is only the bots that are honest about what they are. Some bots pretend to be normal web browsers, so the real figure could well be higher. The thing is, none of this shows up in Google Analytics (or most other analytics tools), because they’re designed to filter bots out and show you the humans. So you can have a site that looks perfectly quiet in your dashboard while the server underneath is absolutely flat out.
Why are search pages such a magnet for crawlers?
Most pages on a website are fairly cheap to serve – once they’ve been built, they can be cached (saved and handed out again) without bothering the database much at all. Search results pages are different. Every search is a fresh question to the database, and on a photo archive with tens of thousands of images, some of those questions are pretty heavy. And because there are endless combinations of search terms, filters and page numbers, a crawler that follows every link can keep finding “new” search pages forever.
That’s exactly what was happening here. Over just three days in November, the server logged around 388,000 requests to search-related pages. The five busiest crawlers made about 293,000 of them, and ClaudeBot was responsible for 175,000 on its own. A later 24-hour snapshot showed 221,000 requests to the site, 166,000 of them to search results pages, and one crawler making around 100,000 – almost all of which went straight through to the server.
So you’ve got the most expensive pages on the site being hit, uncached, by robots, around the clock. That’s why the database was working so hard, and why it had been sized (and priced) so generously in the first place.
Why didn’t we just block them all?
It’s tempting, isn’t it? Flick a switch, ban the bots, job done. But an archive like this actually WANTS to be found. It wants its images turning up in Google, and increasingly it wants to be visible when people ask AI tools about local history too (which is a big part of what I talk about with clients at the moment – if the AI tools can’t read your site, they can’t mention you). Blocking every crawler would protect the server but make the archive invisible, and that’s a really bad trade.
So the approach Tom took was to look at WHERE the bots were causing trouble, rather than treating every bot as the enemy. The individual image pages are what you want indexed, and they’re relatively cheap to serve. The search pages are what was costing money, and nobody needs a crawler to read 175,000 variations of search results to understand what’s in the archive. So the plan became: make the search pages cheaper to run, and slow the bots down on just those pages, while leaving everything else open.
What did we actually change?
There were two halves to this – making the site itself do less work, and then putting some sensible guard rails in front of it. The code changes came first, because there’s no point paying for protection if the site is wasting effort on every visit anyway.
It would be easy to read this and think someone got it wrong first time round, but I want to be clear… This site is well over ten years old, and the search code wasn’t “missed” when it was built. It did exactly what it needed to for more than a decade. Things just change, and right now bots are a much bigger issue than they were back then, so the site needed to work a bit differently. Obviously the more you build into a site at the start, the longer it takes and the more it costs. If something hasn’t been a problem for over ten years, spending the client’s money on it back then wouldn’t have made sense. It’s only worth fixing now because it’s actually costing them something.
Making the site do less work
- Faster search queries. Tom used AWS’s database monitoring to find the most expensive queries, the, using AI to be as quick and time efficient for the client as possible, he rewrote them. He benchmarked the new versions against the old ones and they ran 32-49% faster while returning exactly the same results. So AI caused a chunk of the problem and AI helped fix it!
- Smarter view counting. The site was recording a database write every time an image was viewed, including repeat views in the same visit and views by search engine crawlers. Now it only counts each view once per visit and ignores recognised crawlers, which means fewer writes and more meaningful “most popular” stats.
- Removing a ghost CAPTCHA. Every image page was generating a CAPTCHA (one of those “prove you’re human” puzzles) that the site hadn’t actually used for ages. Every bot visit was paying for that too.
- Only loading the map when someone opens it. Search results were building all the map markers for every search, whether anyone looked at the map or not. Now that only happens when a person clicks into the map view.
Putting Cloudflare in front of it
Cloudflare is basically a layer that sits between your website and the rest of the Internet, and it can cache files, filter traffic and apply rules before anything reaches your server. Once the site was moved behind it, Tom set up:
- Caching for static files like images, stylesheets and scripts, so the server isn’t handing them out over and over
- Rate limiting on the search pages – any automated visitor making too many search requests gets temporarily blocked, with recognised search engines excluded so Google and friends aren’t affected
- A challenge for the worst offender on the search pages only (a challenge is a check that a real browser passes without the visitor noticing, but a crawler usually can’t)
- Blocks for a couple of genuinely abusive visitors – including one bot from the Netherlands generating loads of traffic and a scanner making large numbers of suspicious requests
The second archive site got the same treatment shortly afterwards. It was getting around 87,000 search requests every day, and alongside the same code improvements it now has rate limiting on its search pages (and the behind-the-scenes requests they make), plus challenges for particularly active crawlers including ElevenLabs, SERankingBot and ClaudeBot.
How much money did it actually save?
The database was running on a big Amazon (AWS) server with 4 processors and 32 GB of memory, averaging 35-40% busy with peaks of around 58%. Once the bot traffic was under control and the queries were leaner, Tom halved it.
| Before | After | |
|---|---|---|
| Database server size | 4 vCPUs, 32 GB RAM | 2 vCPUs, 16 GB RAM |
| Average CPU use | 35-40% (peaks ~58%) | ~18% |
| Database compute cost | – | Halved |
That works out at roughly £160 a month, or about £1,900 a year, on one site’s database alone. And even on the smaller server it’s only running at around 18% busy, so Tom’s now looking at whether it can drop down one more size, which could save another £70-75 a month (£850-900 a year). We’re being careful about that one though, because a smaller server also means less memory, and the last thing you want is to save a few pounds and end up with a slow site.
We’re still watching the second archive to see how much its share of the database load drops.
Is that bot really who it says it is?
Every bot introduces itself with a name tag called a user agent, but that name tag is self-declared, and anything can claim to be anything. Interestingly, the very heavy traffic on that first site was all coming from a single IP address (the internet equivalent of a postal address)… which made us wonder whether it was the real thing or something wearing a borrowed name tag. We’re still not 100% sure.
The good news is you can check. Anthropic (the company behind Claude) publishes the IP addresses its crawlers use, so if a “ClaudeBot” is coming from somewhere not on that list, it’s an imposter. They also say ClaudeBot follows the rules in your robots.txt file (a little text file that tells crawlers what they can and can’t read), supports a Crawl-delay setting that asks it to slow down, and won’t try to get past CAPTCHAs – which is partly why a Cloudflare challenge works so well on the genuine article. Other crawlers vary a lot in how well they behave, so it’s worth having a think about which ones you actually want on your site.
What can you do if bots are hammering your site?
You don’t need a huge photo archive for this to matter. Any site with search, filters, a shop catalogue or an events listing has pages that are expensive to run and easy for a crawler to get lost in. If your hosting bill has crept up, or your site feels sluggish even though your analytics look quiet, have a think about working through these:
- Look at your server logs or Cloudflare analytics, not just Google Analytics. That’s where the bots actually show up.
- Find out which pages they’re hitting. It’s usually search, filtered listings or anything with endless combinations of URLs.
- Make those pages cheaper first. Leaner database queries, caching, and not doing work nobody asked for (like that ghost CAPTCHA) all help, and they help your human visitors too.
- Slow the bots down rather than banning them. Rate limiting and challenges on your expensive pages protect the server without making you invisible to Google or AI tools.
- Check your robots.txt. You can ask well-behaved crawlers to slow down or skip certain areas, although obviously the badly behaved ones will ignore it.
- Then review what you’re paying for. Hosting is often sized for the load you had, not the load you’d have without the bots, so there may well be savings sitting there.
And if that all sounds like a lot, or you’d just like someone to have a look at what’s going on under the bonnet of your site, give us a shout.