x
Skip to main content

Process Limits

Stirling PDF sometimes runs external tools to handle tools such as conversions or advanced operations Tools like LibreOffice, Tesseract, Ghostscript, and others. All these tools are optional to Stirling PDFs general operation.

Some tools listed here may not be actively used in the current version of Stirling PDF. Their configuration is kept in place for potential re-introduction in future updates.

Two types of limits are customised for every external tool:

  • Session limits - how many of a given process can run at the same time
  • Timeouts - how long a single process can run before it's killed

Both sit under processExecutor in settings.yml. A value of 0 means "use the default."


Session limits

Controls how many concurrent instances of each process are allowed. Extra requests queue up and wait.

SettingDefaultWhat it controls
sessionLimit.libreOfficeSessionLimit1Word/Excel/PowerPoint/HTML → PDF
sessionLimit.tesseractSessionLimit1OCR (Tesseract is single-threaded)
sessionLimit.pdfToHtmlSessionLimit1PDF → HTML
sessionLimit.ghostscriptSessionLimit8PDF compression, repair, manipulation
sessionLimit.pythonOpenCvSessionLimit8Image processing
sessionLimit.imageMagickSessionLimit4Image conversion
sessionLimit.qpdfSessionLimit2Split, merge, encrypt PDFs
sessionLimit.ocrMyPdfSessionLimit2Add OCR overlay to existing PDFs
sessionLimit.weasyPrintSessionLimit16HTML/CSS → PDF (WeasyPrint)
sessionLimit.calibreSessionLimit1E-book conversions
sessionLimit.ffmpegSessionLimit2Video/audio processing
sessionLimit.installAppSessionLimit1Internal install tasks

Increase limits on a beefy server with concurrent users. Decrease them on low-RAM servers - LibreOffice in particular is memory-hungry.

info

Be mindful of memory and CPU usage when raising session limits. Each concurrent process consumes resources, and setting limits too high can starve the host or cause out-of-memory issues possibly killing the instance. Start with the defaults and increase gradually while monitoring your server.


Timeouts

How long (in minutes) a process can run before it's forcibly killed and an error is returned.

SettingDefault
timeoutMinutes.libreOfficeTimeoutMinutes30
timeoutMinutes.tesseractTimeoutMinutes30
timeoutMinutes.ghostscriptTimeoutMinutes30
timeoutMinutes.pythonOpenCvTimeoutMinutes30
timeoutMinutes.imageMagickTimeoutMinutes30
timeoutMinutes.qpdfTimeoutMinutes30
timeoutMinutes.ocrMyPdfTimeoutMinutes30
timeoutMinutes.weasyPrintTimeoutMinutes30
timeoutMinutes.calibreTimeoutMinutes30
timeoutMinutes.ffmpegTimeoutMinutes30
timeoutMinutes.pdfToHtmlTimeoutMinutes20
timeoutMinutes.installAppTimeoutMinutes60

Increase timeouts if users process very large files that legitimately take longer. Decrease them if you want faster failure and tighter resource control.


Examples

Conservative - low-resource server

processExecutor:
sessionLimit:
libreOfficeSessionLimit: 1
tesseractSessionLimit: 1
ghostscriptSessionLimit: 2
imageMagickSessionLimit: 2
pythonOpenCvSessionLimit: 2
weasyPrintSessionLimit: 4
qpdfSessionLimit: 1
ocrMyPdfSessionLimit: 1
timeoutMinutes:
libreOfficeTimeoutMinutes: 10
tesseractTimeoutMinutes: 15

High-throughput - powerful server

processExecutor:
sessionLimit:
libreOfficeSessionLimit: 4
tesseractSessionLimit: 4
ghostscriptSessionLimit: 16
imageMagickSessionLimit: 8
pythonOpenCvSessionLimit: 16
qpdfSessionLimit: 8
ocrMyPdfSessionLimit: 4
timeoutMinutes:
libreOfficeTimeoutMinutes: 60
tesseractTimeoutMinutes: 60
ocrMyPdfTimeoutMinutes: 60