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
- Considering tuning prerequisites and best practices before testing
- Monitoring performance during testing to determine the resources required by the Mule runtime engine (Mule)
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)
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
Post a Comment