# Performance and Scalability

> Scale TX Text Control .NET Server: threads, ParallelMailMerge processes, container sizing for editing sessions, memory, large documents and best practices.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Performance and Scalability
- **705 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/llms-full.txt

---

Whether an application merges thousands of invoices overnight or keeps hundreds of Document Editors open at the same time, the same questions come up: how many documents one process creates in parallel, how much memory an editing session takes, how large a document may be and when another instance is needed. Developers and operators planning such a deployment get the answers from Text Control's measurements and recommendations, together with the code that applies them.

### Two Kinds of Load

An application with TX Text Control .NET Server carries two kinds of work, which grow differently:

| Work | Where it runs | What it uses | Grows with |
|---|---|---|---|
| Document processing with `ServerTextControl` and `MailMerge`: generating, merging, converting | In the process of your application, or in worker processes that it starts | CPU and memory, depending on the documents | The number and size of the documents |
| Editing sessions of the Document Editor | In a worker process of the backend `TXTextControl.Web.Server.Core` for each open editor | 50 to 150 MB of memory per session | The number of concurrent editors |

Text Control describes processing as unpredictable, CPU-heavy work and editing as predictable, memory-bound work. For many concurrent users, it recommends running them in separate services that scale on their own, as [Scaling Beyond One Instance](https://docs.textcontrol.com/tx-text-control-dotnet-server/overview/architecture/#scaling-beyond-one-instance) summarizes.

### Find the Right Page

| If you want to | Read |
|---|---|
| Create documents on several threads, in request handlers or in background services | [Threading](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/threading/llms-full.txt) |
| Merge large batches in parallel worker processes with `ParallelMailMerge` | [Multiple Processes](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/multiple-processes/llms-full.txt) |
| Size containers for editing sessions and scale document processing on CPU or queue length | [Container Scaling](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/container-scaling/llms-full.txt) |
| Understand where memory is used, dispose instances and watch editing sessions | [Memory Usage](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/memory-usage/llms-full.txt) |
| Show, upload, merge and process documents with thousands of pages | [Large Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/large-documents/llms-full.txt) |
| Apply measured recommendations and measure your own workload | [Performance Best Practices](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/best-practices/llms-full.txt) |

### Where to Start

1. [Performance Best Practices](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/best-practices/llms-full.txt): the measures that make each document faster, from the choice of the engine to the moment the PDF is created.
2. [Threading](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/threading/llms-full.txt): the rules for `ServerTextControl` in a web application.
3. [Multiple Processes](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/multiple-processes/llms-full.txt) when you process large batches, or [Container Scaling](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/container-scaling/llms-full.txt) when many users edit documents at the same time.

The [Deployment Guide](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/llms-full.txt) shows how to run several instances behind a load balancer, and [Scaling Containers](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/docker/scaling/llms-full.txt) which requests need sticky sessions.

---

## In This Section

- [Performance Best Practices](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/best-practices/llms-full.txt): Measured ways to speed up TX Text Control: the Core engine, Selection objects, the internal format, a late PDF, short requests and measuring your own workload.
- [Container Scaling](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/container-scaling/llms-full.txt): Size and scale containers for TX Text Control: memory per editing session, CPU for the backend, scaling processing on CPU or queue length and licenses.
- [Large Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/large-documents/llms-full.txt): Handle documents with thousands of pages: viewer streaming, request size limits in Kestrel and IIS, long merges, text replacement in large DOCX and PDF size.
- [Memory Usage](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/memory-usage/llms-full.txt): Track memory in TX Text Control: ServerTextControl in your process, editing sessions in worker processes, spell check dictionaries and disposing instances.
- [Multiple Processes](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/multiple-processes/llms-full.txt): Merge large batches in several processes with ParallelMailMerge: why processes, the worker handoff, parallel jobs, ASP.NET Core, options and measurements.
- [Threading](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/threading/llms-full.txt): Use ServerTextControl and MailMerge on several threads: thread safety and critical sections, one instance per operation, parallel loops and background work.

---

## Nearby

- **Previous:** [Compliance](https://docs.textcontrol.com/tx-text-control-dotnet-server/security/compliance/llms-full.txt)
- **Next:** [Threading](https://docs.textcontrol.com/tx-text-control-dotnet-server/performance/threading/llms-full.txt)
