> For the complete documentation index, see [llms.txt](https://icij.gitbook.io/datashare/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://icij.gitbook.io/datashare/server-mode/performance-considerations.md).

# Performance considerations

A short summary of what makes Datashare fast or slow, and where the detailed guidance lives.

Extracting text from arbitrary file formats and running OCR over images is expensive work. Datashare uses [Apache Tika](https://tika.apache.org/) and [Tesseract OCR](https://tesseract-ocr.github.io/) to do it as efficiently as it can, but on a large corpus the settings you choose matter more than the machine you rent.

The detailed guidance now lives in [Tuning and performance](/datashare/server-mode/indexing/tuning.md). In short:

* **Match threads to cores.** Set `--parallelism` to the number of cores and make sure `OMP_THREAD_LIMIT=1` reaches Tesseract. Getting this wrong is routinely a 30x slowdown. [Read more](/datashare/server-mode/indexing/tuning.md#the-single-most-important-setting).
* **Decide about OCR.** It is on by default and it dominates the cost. Turn it off for born-digital corpora, and install the right Tesseract language packs when you keep it on. [Read more](/datashare/server-mode/indexing/tuning.md#ocr).
* **Split the stages and distribute INDEX.** With a shared Redis queue and a shared Elasticsearch, adding machines adds throughput almost linearly. [Read more](/datashare/server-mode/indexing/scenarios.md#scenario-5-distribute-indexing-across-several-machines).
* **Give Elasticsearch its own machine.** It becomes the bottleneck before your indexing workers do. [Read more](/datashare/server-mode/indexing/tuning.md#elasticsearch).
* **Size the heap deliberately** with `DS_JAVA_OPTS` and `ES_JAVA_OPTS`. [Read more](/datashare/server-mode/indexing/tuning.md#memory).
* **Treat mail archives as a special case.** One mailbox file is one queue entry, so a corpus of a few very large mailboxes leaves a big machine underused. [Read more](/datashare/server-mode/indexing/tuning.md#mail-heavy-corpora).
* **Tell Datashare the language** when your corpus is monolingual, with `--language` and `--ocrLanguage`. [Read more](/datashare/server-mode/indexing/tuning.md#language).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://icij.gitbook.io/datashare/server-mode/performance-considerations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
