The cheapest Solr optimisation is asking for less: fewer rows, and only the fields the page shows.
A search result page shows ten or twenty results. A request for a thousand costs a thousand documents read from disk, decompressed, cached and serialized, on every single call. The numbers below are one query against one of our own indexes, changing nothing but rows.
Ten times the rows is ten times the payload, ten times the decompression and ten times the cache pressure.
| Request | Response size | What it costs on the server |
|---|---|---|
rows=10 | 10,766 bytes | Ten documents materialized. A normal search page. |
rows=100 | 103,790 bytes | Still reasonable. This is the sensible ceiling for a page. |
rows=1000 | 1,053,533 bytes | A megabyte per request, plus a documentCache entry for every document. |
Keep rows under 100 for anything a user looks at, and always send an fl list. A field list is the cheapest optimisation available: a result page that shows a title, a price and a link has no reason to transport the full body text of every document.
GET /solr/mycore/select ?q=running shoes &rows=20 &fl=id,title,price,url
Solr best practices
Ask for fewer rows and fields (this page)