High CPU Usage using Aspose Products

Hi, We are seeing irregular spikes in CPU usage on our system. Our project is deployed on kubernetes pods & docker containers. All of our Aspose operations are in this one project. We believe that this is may be
image.png (43.7 KB)

happening due to conversion of excel to pdf / word to pdf & powerpoint to pdf.

We see that some conversions of excel (550kb file size) to pdf are taking sometimes over a minute. And even large word documents are taking some time.

However, even when there is less or no load on the endpoints, we are seeing spikes in CPU for no reason(shown in picture).

Operations being performed in this project with Aspose

-Creating a table in a word document & returning the document

-Creating a few paged PDF document & returning

-Creating a few paged word document & returning

-Converting word to pdf, excel to pdf, powerpoint to pdf

We are using .NET C#

Aspose Cells version 25.1.1

Aspose.Pdf.Drawing version 24.12.0

Aspose.Slides.NET6.CrossPlatform version 25.1.0

Aspose.Words version 25.1.0

Overall, we want to know

-why some file conversions are taking a long time (over a minute) & if we can lower this time

-why we are having extremely large CPU Spikes from 0 GB cpu to 14 GB cpu usage then back down to 0gb

Please let us know if you have any insights.

Thank you

@prodigy234

High CPU usage and slow conversion times can be challenging, especially in a Kubernetes and Docker environment. Here are some insights and suggestions to help you address these issues:

  1. Conversion Time:

    • The time taken for conversions (such as Excel to PDF or Word to PDF) can vary based on the complexity of the documents, the size of the files, and the resources allocated to your containers.
    • To potentially reduce conversion times, consider optimizing the documents before conversion. For example, simplifying complex Excel formulas or reducing the number of images in Word documents can help.
    • Explore using asynchronous processing for conversions to avoid blocking operations and improve responsiveness.
  2. CPU Spikes:

    • High CPU usage can occur due to several factors, including inefficient resource allocation, high concurrency, or memory leaks in the application.
    • Monitor your application to identify which specific operations are causing the spikes. Tools like Prometheus or Grafana can help visualize resource usage over time.
    • Ensure that your Kubernetes pods are appropriately scaled and that resource limits are set to prevent any single pod from consuming excessive CPU.
  3. Performance Optimization:

    • Review the performance optimization guidelines provided by Aspose for the specific product you are using. For instance, you can limit the number of threads used during processing or adjust settings related to image processing to enhance performance.
    • Consider upgrading to the latest versions of Aspose libraries, as they may include performance improvements and bug fixes.
  4. Testing and Profiling:

    • Conduct load testing to simulate various scenarios and identify bottlenecks in your application. Profiling your application can also help pinpoint areas that require optimization.

By implementing these strategies, you should be able to mitigate CPU spikes and improve the performance of your document conversions. If issues persist, consider reaching out to Aspose support for more tailored assistance.

Feel free to ask if you have more specific questions or need further assistance!

@prodigy234,

Thank you for sharing the screenshot and details.

We recommend using the latest versions of the .NET APIs (such as Aspose.Words, Aspose.Cells, Aspose.PDF, Aspose.Slides, etc.) for your tasks, as the newer versions come with improved fixes and enhancements. Should you continue to experience high CPU usage, we would greatly appreciate it if you could provide the following:

  1. Sample or input documents (e.g., Word, Excel, PowerPoint, etc.) that you are using and that may be causing the CPU usage spikes.
  2. The sample code you are utilizing with Aspose for .NET APIs.

Once we receive these details, we will evaluate the issue using your provided files and code snippet and share our findings and insights with you.