Creating a DOCX

I ran it by cursor to get a quick understanding of whether it was viable and valuable to switch despite almost perfecting my current HTML → PDF solution.

For my particular application there is a strong risk of many concurrent users as the core feature of the site is the create of the PDF’s

HTML to PDF (Current with Lucee):

Memory Usage:

Lightweight - uses Lucee’s built-in PDF engine

Each conversion ~10-20MB RAM

Memory released efficiently after conversion

Predictable memory footprint

Concurrency:

Native to Lucee’s PDF engine

Efficient request handling

No external process overhead

Clean resource management

Speed:

Fast conversion time

No startup delay

Immediate processing

Direct output

Reliability:

Integrated with Lucee

Minimal failure points

Self-contained

Predictable behavior

With 64GB RAM and 4-core CPU, estimated concurrent users:

~2000-3000 concurrent conversions possible

Memory usage: 20MB × 2000 = 40GB

CPU becomes main bottleneck

Very efficient memory cleanup

LibreOffice Approach:

Memory Usage:

~200MB per LibreOffice instance

Requires queue management overhead

Longer memory retention

Higher per-conversion footprint

Concurrency:

Needs queue system

Process creation overhead

Complex cleanup required

Resource intensive

Speed:

Slower (LibreOffice startup)

Queue waiting times

Heavy disk operations

Process initialization cost

Reliability:

External LibreOffice dependency

Multiple failure points

Complex process management

OS resource dependencies

With 64GB RAM and 4-core CPU, estimated concurrent users:

~30-40 concurrent conversions maximum

Memory usage: 200MB × 30 = 6GB

CPU heavily impacted by LibreOffice processes

Limited by process management overhead

Summary for 4-core CPU, 64GB RAM scenario:

HTML to PDF (Lucee):

Better choice

Could handle 2000+ concurrent users

Memory efficient

CPU efficient

LibreOffice:

More resource intensive

Limited to 30-40 concurrent users

Higher system impact

Process management overhead

Recommendation:

Stick with Lucee’s HTML to PDF - it will handle significantly more concurrent users with the same hardware and is much more efficient in both memory and CPU usage.