Account Resources

Opensolr Account Resources — find answers to your questions

Solr Traffic Bandwidth

Opensolr does not bill by the number of requests. It bills the bytes your index sends back. A tight query and a sloppy one cost the same to make, but not the same to answer.

1,000,000 lean responsesa few bytes each1 GBsame bandwidthsame bill1 heavy responseevery field, every row, no filtersonly the fields you need

One gigabyte of bandwidth is a million lean responses, or one heavy one. What you ask for decides which.

01 · What is counted

On a pre-paid plan you are billed for the outgoing bytes sent from your Opensolr index to your site or app. Nothing else. Not the number of queries, not the size of your index, not the traffic your own site receives.

Every field you return, every row you fetch and every facet you do not need is bandwidth. Return only the fields the page shows, page results instead of pulling thousands of rows, and use filters so the index does the narrowing. The best practices guide covers each of these.
02 · Why is my bandwidth high
Visitorsand botsYour search pageOpensolrindexevery hit becomes a queryoutgoing bytes = billedonly this direction is counted

Whoever reaches your search page, human or bot, triggers a query. The response coming back from the index is the part that counts.

  • Bots and crawlers visit search pages far more than people do, and each visit becomes a query against your index.
  • Heavy responses multiply that. A search page that returns full documents with every field makes every bot visit expensive.
  • A sudden overnight spike is almost always a crawler loop or a scripted attack on the search page, not real visitors.

03 · How to send fewer bytes

Return only what you show

Use rows and fl so each answer carries the results and the fields the page displays, and nothing else. Returning 100,000 records to display 10 is the most common cause of a bandwidth spike.

/select?q=mysearch&rows=10&fl=id,title

Cache on your side

Keep search results in your own cache (Redis, Memcached, whatever your framework offers), so a page reload, an autocomplete keystroke or a back-button click does not query the index again.

Let the index narrow

Filter with fq and page through results, instead of fetching thousands of rows and filtering them in your code.

Split the traffic across two indexes

Bandwidth is counted per index. Replicate index A into index B and let your application query both in turn: two indexes, two monthly allowances.

04 · Where to see who is using it

Request log API

Query and facet the request log of your index by any field. Facet by IP and path to see exactly who uses the bandwidth: API: Get Index Request Log.

Query Analytics

Traffic over time, popular queries and slow queries, per index, in the control panel: Query Analytics.

Live Query Stream

Every request as it arrives, so a crawler loop or an attack shows the moment it starts: Live Query Stream.

05 · Monthly allowance and limit

Each index has its own monthly bandwidth from your plan. It starts again on the 1st of every month, you get an email at 90%, and an index over its allowance answers every request with 403 until it is back under. Details: bandwidth.

Read Full Answer

Stop Bots and AI Crawlers From Using Up Your Search Bandwidt...

Bots and AI crawlers can use up the monthly bandwidth of your Opensolr Index in days. They do it through the search page of your own website: every page they open there runs a query against your index. This page explains why it happens and every step you can take to stop it, in the order that helps most.

01 · Why bots use up your bandwidth

Your website sends a query to your Opensolr Index every time someone opens a search page or clicks a filter. It does not matter if that someone is a person or a bot. Opensolr counts the bytes each answer sends back: Solr Traffic Bandwidth.

  • Filters and facets create endless pages. Every combination of filters is a new URL. A crawler follows every link it sees, so ten filters with a few values each turn into millions of URLs, and each one is a query.
  • AI crawlers are aggressive. Bots that collect content for AI models open pages much faster than search engines, and often come back over and over.
  • Scrapers and attack scripts call search pages directly, with random words, to copy your content or to test your site.
  • A sudden spike overnight is almost always one of the above, not real visitors.
Why Opensolr cannot filter these bots for you. When your website searches on the server side, every query that reaches your index comes from your own server, with your own username and password. To Opensolr it is a valid request from you. The bot is stopped only on your website, before it makes your server send the query.

02 · Step 1: Keep crawlers out of search and filter pages

Well behaved crawlers, including the known AI crawlers (GPTBot, ClaudeBot, CCBot, Google-Extended, PerplexityBot and similar), read your robots.txt and obey it. Tell them not to open search results and filter URLs. Put a file named robots.txt at the root of your website, for example https://www.example.com/robots.txt. Change the paths and parameter names to the ones your site uses:

User-agent: *
Disallow: /search
Disallow: /*?q=
Disallow: /*&q=
Disallow: /*?f[
Disallow: /*&f[
Disallow: /*?filter=
Disallow: /*&filter=

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
User-agent: PerplexityBot
User-agent: Bytespider
User-agent: Amazonbot
Disallow: /

The first block keeps every crawler away from search and filter URLs. The second block keeps the listed AI crawlers away from the whole site. Remove the second block if you want AI tools to read your content.

Then, in the HTML of your pages:

  • Filter and facet links: add rel="nofollow", so crawlers do not follow them. Example: <a href="/products?color=red" rel="nofollow">Red</a>
  • Search results pages: add <meta name="robots" content="noindex, nofollow"> in the <head>.
  • Filtered listing pages: add a canonical tag pointing to the page without filters. Example: <link rel="canonical" href="https://www.example.com/products">
robots.txt only stops bots that choose to obey it. The next steps stop the ones that do not.

03 · Step 2: Cache search results on your server

When a bot opens the same search or the same filter combination many times, your server should answer from its own cache, without asking your Opensolr Index again. Keep each search result in a cache (Redis, Memcached, or the cache of your framework) for 60 seconds or more. Use the search words plus all the filters plus the page number as the cache key.

$key = 'search:' . md5($query . '|' . json_encode($filters) . '|' . $page);
$result = $cache->get($key);
if ($result === null) {
    $result = $solr->search($query, $filters, $page);
    $cache->set($key, $result, 60);
}

Even a short cache turns thousands of identical bot requests into one query to your index. Your pages also load faster for real visitors.

04 · Step 3: Limit how fast one visitor can search

A person searches a few times per minute. A bot searches many times per second. Limit the number of search requests one IP address can make on your web server, and the bots that ignore robots.txt are slowed down automatically, without having to know who they are.

Nginx, 2 searches per second per IP address, with short bursts allowed:

# in the http { } block
limit_req_zone $binary_remote_addr zone=search:10m rate=2r/s;

# in the server { } block, on your search path
location /search {
    limit_req zone=search burst=10 nodelay;
    limit_req_status 429;
    # ... your existing configuration for this path
}

Apache: install the module mod_evasive, which blocks an IP address that sends too many requests in a short time. fail2ban works with any web server: it reads your access log and blocks, in the firewall, the IP addresses that request your search page too often.

If your website is behind a CDN or a proxy, limit by the real visitor address that the proxy forwards, not by the address of the proxy.

05 · Step 4: Make your search page harder to abuse

  • Do not search on empty input. If the search box is empty or has one character, show the page without sending a query.
  • Limit the page number. Do not let anyone ask for page 5,000 of the results. Show a fixed maximum, for example 50 pages.
  • Show a challenge after many searches. When one IP address makes more searches than a person would, show a CAPTCHA before the next one.
  • Block bad user agents you see in your access log, for example empty user agents or known scraping tools. User agents can be faked, so use this together with the rate limit, never alone.

06 · Step 5: If your page searches straight from the browser

Some sites call the Opensolr Index directly from JavaScript in the visitor's browser: search from the browser. In that case the address and the login of your index are visible in the page, and a bot can call your index directly, without going through your website. None of the steps above can stop it.

For a public website that receives bot traffic, send the searches through your own server instead (your page calls your server, your server calls the index). Then caching and rate limiting work, and the index stays hidden.

07 · Step 6: Lock and lighten your index on Opensolr

  • Allow only your servers. With IP rules, only the addresses of your own servers can use your index. Nobody else can reach it, even with the password: IP restriction and IP rules by handler. By API: Add index IP access rule.
  • Send fewer bytes per answer. Ask only for the fields your page shows (fl) and only the rows it shows (rows). Every bot visit then costs a fraction of what it cost before: Solr best practices.
/select?q=laptop&rows=10&fl=id,title,url
IP rules also apply to the Opensolr features that read your index (the hosted search page, the Chat Bot, AI answers). Check what a rule can stop before you add one.

08 · Find out who is using your bandwidth

  • Request log API: search and facet every request your index received, by IP address, by path and by date, to see exactly where the traffic comes from: API: Get Index Request Log.
  • Query Analytics: traffic over time and the most frequent queries, in the Control Panel: Query Analytics.
  • Live Query Stream: watch the queries reaching your index as they arrive: Live Query Stream.
  • Email at 90%: you get an email when an index has used 90% of its monthly bandwidth, so you can act before it is blocked.

Random words, the same filters repeated thousands of times, or very high page numbers in your log are the signature of bot traffic.

09 · If you already reached your bandwidth limit

An index over its monthly bandwidth answers every request with an error (403) until it is back under its limit. The allowance starts again on the 1st of every month: bandwidth.

To have your search working again right away, upgrade your plan with more bandwidth at https://opensolr.com/pricing. The index is unblocked once the new allowance is in place. When the steps on this page are in place and the bot traffic is gone, you can go back to a smaller plan from the same page: change or cancel your plan.

10 · Checklist

  • robots.txt blocks search and filter URLs, and the AI crawlers you do not want.
  • Filter links have rel="nofollow", search pages have noindex, filtered pages have a canonical tag.
  • Search results are cached on your server for at least 60 seconds.
  • Your web server limits searches per IP address (nginx limit_req, Apache mod_evasive or fail2ban).
  • No query on empty input, a maximum page number, a CAPTCHA after too many searches.
  • Searches go through your server, not straight from the browser.
  • IP rules on your index allow only your servers.
  • Every query asks only for the fields and rows the page shows.
  • You check the request log when the 90% email arrives.
Read Full Answer

Solr Best Practices

Solr does not run out of memory because it is busy. It runs out because of what it was asked for: a page ten thousand results deep, a facet on a field that has to be un-inverted first, a query that returns every field of a thousand documents. This page is the list of the requests and settings that cost memory, what each one costs, and what to do instead.

ON THE JVM HEAPOFF HEAP, MEMORY MAPPEDFilter cache bitsetsQuery result windowsUn-inverted field dataStored documents in cacheAnalyzers, merges, threadsInverted indexpostings and termsdocValues columnsfaceting, sorting, groupingStored field datathe documents you returnBounded by the heap size.This is the one that runs out.Bounded by free RAM.The operating system manages it.

A Solr node uses two kinds of memory. Only the left-hand side has a hard ceiling.

The guide, one page per topic

Where Solr memory goes

The JVM heap and the memory-mapped index: which one has a hard ceiling.

Ask for fewer rows and fields

Every returned document is read, decompressed, cached and sent.

Deep paging and cursorMark

The cost of a page grows with its offset. cursorMark keeps it flat.

docValues and the TextField trap

Facet, sort and group from disk instead of the heap, and the type that cannot have them.

Cache sizing

filterCache, queryResultCache and documentCache, sized against your document count.

Faceting, grouping and highlighting

What each one costs and how to ask for less.

Queries that fail on their own

Too many clauses, leading wildcards, regular expressions and other queries that throw.

Indexing without a memory spike

Batch sizes, commits and the searcher that every commit opens.

Never put binary data or base64 into Solr

Pictures, files and any base64 blob have no place in a search index.

Inline base64 images in indexed HTML

Pictures pasted into a CMS editor get indexed inside the page HTML.

N-gram fields belong on short text only

Partial matching that multiplies the index when used on long text.

Suggesters that rebuild on every commit

Autocomplete that reads the whole index on every commit.

Dynamic field explosion

Field names generated per site or environment, paid for in every segment.

When one document keeps crashing Solr

One oversized document that fails every indexing run.

CMS integrations that commit every second

Per-second commits from CMS modules and what they cost.

If you connect through a CMS

Most of the traffic we see is generated by a module rather than by hand, which means the fix is usually a setting in the module and not in Solr.

Drupal

Keep search_api_solr and the Opensolr module current — several releases have fixed query construction bugs that produced far heavier requests than intended. Check the enabled facets and the number of items per page before blaming the index.

WordPress

The plugin defaults are sane; the memory problems come from templates that request every field to render a result card. Trim the field list in the template.

Bots reach your search page too

A paginator that a crawler can walk will be walked, one deep page at a time. Rate limit the search path, or mark deep pages as not indexable.

What Opensolr does when it happens anyway

Automatic recovery

Every server is checked from outside itself. A failed check is retried ten seconds later, and if it still fails, the services on that server are restarted and the recovery is logged.

Query Analytics

Query volume, response times and the slowest queries per index: a deep paging loop or a runaway facet shows up as a shape, not as an outage.

Error Audit

Every Solr error of your index, parsed and searchable, so an exception at three in the morning is still there when you look for it.

Unusual traffic alerts

A daily check of the request log emails the owner and the team when an index sees deep paging, a sudden traffic spike, one address flooding it or a wave of rejected logins, with the request that triggered it.

The short version

DoBecause
Keep rows under 100 and always send flEvery returned document is read, decompressed, cached and serialized.
Keep start under 50,000, and use cursorMark to exportThe cost of a page grows with its offset: 74 ms at the start became 5,988 ms a million results deep (deep paging).
Put docValues="true" on every field you facet, sort or group byOtherwise the column is rebuilt in the heap and stays there.
Never put docValues on a solr.TextFieldThe core will not load. Use a string copy or solr.SortableTextField.
Size caches against your document countOne filterCache entry can be one bit per document in the index.
Ask for the facet values you displayfacet.limit=-1 counts and returns every distinct value in the field.
Batch your indexing and commit on a scheduleA commit per document is a searcher per document.
Store only what you returnStored fields are index size, cache size and bandwidth at the same time.

Read your own numbers first

The slow queries, the deep pages and the heavy responses of your index are in its analytics. Start there, then pick the page above that matches what you see.

Query AnalyticsLive Query Stream

Read Full Answer

Loading more articles...