Skip to main content

Performance Tuning in Mule4 Applications

To achieve optimal performance from your Mule applications, you must evaluate both the applications themselves and the environment in which they run. Although Mule 4 is designed to tune itself, your applications might exhibit performance issues due to their initial construction or dependencies.

Similarly, for on-premises installations, you might need to tune the environment itself so that your Mule applications can take full advantage of it. Because many variables influence it, tuning the performance of your application requires some trial and error.

You can simplify performance tuning by using documented best practices and testing your applications in ideal test environments. The following recommendations come from the Development and Services Engineering teams and benchmarking efforts by MuleSoft Performance Engineering.


Optimizing the performance of your Mule apps requires the following actions:

  • Applying tuning recommendations at the application level
          See Performance Tuning Recommendations for details.
  • Considering tuning prerequisites and best practices before testing
        See Performance Test Validations for details.
  • Monitoring performance during testing to determine the resources required by the Mule runtime engine (Mule)
See Performance Monitoring for details.

 Application level :


Repeatable vs Non-repeatable Streaming

Understand which streaming strategy results in the best flow performance for your use case:
  • A repeatable stream (read payload more than once)
  • A non-repeatable stream (read payload only once)
See Repeatable vs Non-repeatable Streaming for details.

Back-Pressure and MaxConcurrency

Understand back-pressure and learn how to use the maxConcurrency parameter to tune the number of concurrent messages sent to your flow.

See Back-Pressure and MaxConcurrency for details.

Backend Server Response Time

Understand if the average latency and throughput of backend servers is limiting the scalability or performance of your application.

See Backend Server Response Time for details.

Caching

Understand when to use cache and which cache-strategy to follow, based on key aspects of your data. Mule offers some customizable mechanisms, such as Cache Scope and the HTTP Caching API Gateway policy, to enable cache according to your needs.


See Caching for details.

Pooling Profiles

Pooling components helps process simultaneous incoming requests. Understand how to add add pooling-profile to connectors when performance tests show that it is necessary.

See Pooling Profiles for details.

Domains

Using domains provides a central repository for all the shared resources, facilitating the class-loading process. Domains enhance performance when you deploy multiple services on the same on-premises instance of Mule runtime engine.

See Domains for details.

Logging

Understand why asynchronous logging performs better than synchronous logging.

See Logging for details.

Batch Processing

Mule can process messages in batches, but batch processing requires having enough available memory to process the threads in parallel, which means moving the records from persistent storage into RAM in a fixed-size block. Understand how to configure the batch block size property for your application.


See Batch Processing for details.

Application Design Best Practices


Following certain practices at the design phase helps you to achieve better performance for your Mule apps.

See Application Design for details.

Performance Test Validation Prerequisites

Before executing performance testing:
  • Confirm that your Mule app and its functions work as expected because a wrong flow can give false-positive data.

  • Establish performance test criteria by asking yourself the following questions:

    • What are the expected average and peak workloads?

    • What specific need does your use case address?:

      • Throughput, when handling a large volume of transactions is a high priority.

      • Response time or latency, if spikes in activity negatively affect user experience.

      • Concurrency, if it is necessary to support a large number of users connecting at the same time.

      • Managing large messages, when the application is transferring, caching, storing, or processing a payload bigger than 1 MB.

    • What is the minimum acceptable throughput?

    • What is the maximum acceptable response time?


Comments

Popular posts from this blog

MQ-Based Integration vs. REST API-Based Integration: Choosing the Right Path for Your Architecture

In today's interconnected world, integration is at the heart of seamless operations.  Two of the most popular methods for connecting systems are  1. Message Queue (MQ)-based integration  2. REST API-based integration. But how do you choose the right one for your needs? 🔄 MQ-Based Integration : - Asynchronous Communication : Ensures reliability and resilience, allowing systems to communicate without waiting for an immediate response. Perfect for handling high volumes of data and complex workflows. - Decoupled Systems : MQ allows systems to operate independently, reducing dependencies and enhancing scalability. - Guaranteed Delivery : Messages are queued and delivered even if the destination system is temporarily unavailable, ensuring that no data is lost. 🌐 REST API-Based Integration : - Synchronous Communication : Ideal for real-time, request-response interactions where immediate feedback is needed. - Ease of Use : REST APIs are widely adopted, easy to implement, and pe...

Microservices design patterns

Microservices design pattern Next :  saga-design-pattern-microservices