Latency is high for optimize pdf even in on premise

Hi team,

We are seeing high latency (around 10+ sec for compressing 2 mb file). Is this expected? I saw that resource utilization was also within limit.

@rajatdpw

Can you please explain a bit more by sharing sample code snippet, environment details and sample file for our reference? We will test the scenario in our environment and address it accordingly.

I am testing in local using on premise approach using docker image for aspose pdf
image: aspose/pdf-cloud:latest

I am making an Axios call from my pod to the one we created using a docker image.

let data = JSON.stringify({
                "CompressImages": true,
                "ImageQuality": 50,
                "LinkDuplcateStreams": true,
                "RemoveUnusedObjects": true,
                "RemoveUnusedStreams": true,
                "UnembedFonts": true,
                "SubsetFonts": true,
                "ImageEncoding": "Unchanged",
                "RemovePrivateInfo": true,
                "ImageCompressionVersion": "Standard"
            });
            let asposePdfUrl = getAsposePDFUrl();

            let configuration = {
                method: 'post',
                url: asposePdfUrl + '/' + fileName + '/optimize?folder=compress',
                headers: {
                    'accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                data: data,
                maxBodyLength: Infinity,
            }

await axios(configuration)
                .then(function (response) {
                    if (response.status === 200) {
                        logger.info(`File compressed successfully.`);
                    }
                    else {
                        logger.error(`Error while compressing the file, Response Status Code: ${response.status}`)
                    }

                })
                .catch(function (error) {
                    throw error;
                });

Please note that I am able to compress file so no issues as such with compressing a document.

This topic has been moved to the related forum: Latency is high for optimize pdf even in on premise - Free Support Forum - aspose.cloud