Forum How do I...?

How do I create a pdf of thousands pages fast?

TomWu
Hi Mike,

I just got another performance issue again, which takes more than 10 minutes to generate a 1200 pages PDF. This is timing out on our server.

How many pages is Prince made to support and with reasonable speed, under a few minutes?

We are generating a report of transactions that is over 2000 pages. Should we find a different solution for these kinds of reports?

This is a simple HTML file, which is largely one big table. It's 17MB, basically like the one I've sent you before.
Running on Windows Server 2012. (AWS C4.large).

Is there an IO issue? As we're still writing to the local Window's TMP folder, though we could change this to use the SSD.

Thanks in advance!
mikeday
It's a question of cpu and possibly RAM usage if there is thrashing. Can you check the memory usage while Prince is converting the document?
TomWu
Hi Mike,

Thanks for the quick response. We've been busy investigating this further. When called from IIS, memory usage for the prince.exe process quickly grows to between 1 to 1.3 GB and stops, CPU usage drops off to zero and it appears the process has stalled. When we tried running the same prince command directly in the console on this machine, memory usage grows to over 1.7 GB and the report is generated in about 2 minutes. CPU usage is high on one of the CPU cores until it's done.

So we suspect the limitation is because our IIS application is running in 32bit mode and this mode is inherited in any processes it creates. We'll work to remove the dependancy that forces the app to work in 32bit mode, as we've been intending to do so for sometime.

Is using so much RAM usual for Prince with large files? It still seems like a big discrepancy, a 17MB HTML file needs 1.7GB of RAM to process into a PDF. Is there anything we can do to avoid such a big multiplier?

Thanks
TomWu
Just tried it now with out javascript, memory usage doesn't grow as fast, initially to about 800MB but halfway through grows to about 1.1GB. So while much better, we'll probably still have an issue while stuck in 32bit mode.

mikeday
Perhaps you could try with our latest build and see if memory usage is reduced? We are still working on cutting memory usage, but documents with many little elements like tables with thousands of cells are particularly difficult to handle.