I am facing an issue of High CPU usage while compressing files. The scenario i have is a .Net WebService, that compresses PDF Documents with about 500kb.
I have a balanced two servers infrastructure, quad core with 8GB RAM, and a Round Robin load balancer in front of.
I've implemented firstly by launching the GS.exe, with the switches to compression, and seeing that the CPU usage is always at 100%, i´ve implemented in C# referencing the nuget Artifex GhostScript.Net with the same switches.
The Switches that i use are in both cases are:
sDEVICE=pdfwrite
-sDEVICE=pdfwrite
-dBATCH
-dNOPAUSE
-dPDFSETTINGS=/ebook
-dAutoRotatePages=/None
-dPrinted=false
-dNOSUBSTDEVICECOLORS
-dDEVICEWIDTH=2479
-dDEVICEHEIGHT=3508
-dColorImageResolution=300
-dGrayImageResolution=300
-dColorImageDownsampleType=/Bicubic
I've also played around with dNumRenderingThreads, without any success.
How can I optimize the CPU usage to present 100% consumption? Is there any switch? How to prevent this High CPU using GhostScript ?
I've already dig around, tried to use another libraries, however the do not compress well, and i am stuck it this CPU usage in GhostScript.
Any hint, help how to resolve this situation ?
Thanks in advance.