Docling
Performance Configuration
Docling uses a worker pool architecture where workers are automatically split into two groups for quality of service:- Small file workers: Process files less than 1MB and less than 100 pages
- Large file workers: Process files greater than or equal to 1MB or greater than or equal to 100 pages
Configuration Parameters
numWorkers: Total number of workers (automatically split 50/50 between small and large file processing) numThreads: Total threads available across all workers. Each worker receivesnumThreads / numWorkers threads.
Configuration Constraints and Strategy
Configuration Constraints and Strategy
Constraints
numWorkers >= 2and must be evennumThreads >= 2numThreadsmust be divisible bynumWorkers- Recommended: Leave at least 20-30% of cores free for system processes
- Maximizes parallel processing of multiple small documents
- Use when processing many PDFs under 100 pages
- Allocates more computational power per document
- Use when processing scanned books or technical manuals
Extra Configuration
tableMode: Controls table extraction strategyaccurate: Maximum precision, higher processing time (default)fast: Speed-optimized with good accuracynone: Disables table extraction
true)
forceFullPageOCR: Forces full-page OCR instead of selective regions. Use when standard extraction misses content. Significantly increases processing time (default: false)
Example Configurations
The following examples consider a system with 48 CPU cores. AdjustnumWorkers and numThreads based on your system’s CPU count and workload characteristics.
Balanced Workload
Balanced Workload
Use case: Steady workload with moderate file volume and average file sizesWhat this does: Middle ground between high throughput and heavy processing. Provides 2 workers for small files and 2 for large files with 9 threads each, balancing concurrency and processing power.
Many small documents (High Throughput)
Many small documents (High Throughput)
Use case: Processing large volumes of documents under 100 pages and under 1MBWhat this does: Maximizes concurrent file processing with 8 workers for small files and 8 for large files. Reduces threads per worker to increase parallelism. Uses fast table extraction to optimize speed over precision.
Heavy Documents (Complex or Large Files)
Heavy Documents (Complex or Large Files)
Use case: Processing fewer but larger or more complex documents with detailed tables
What this does: Allocates more computational power per document with 8 threads per worker. Uses only 2 workers for small files and 2 for large files to focus resources on thorough processing of complex content.
Scanned Documents (OCR Intensive)
Scanned Documents (OCR Intensive)
Use case: Processing primarily scanned documents or images requiring full OCR extractionWhat this does: Reduces worker count to allocate more threads per worker for intensive OCR processing. Enables full page OCR to extract text from scanned images. Uses fewer workers (2 for small, 2 for large) with 10 threads each to maximize processing power per document.