0

I have a flow that uses a batch process to synchronize data into two target systems after receiving data from a source.

The batch contains two steps, and each step is encapsulated inside a try scope to catch failed records and store them in an Object Store.

  • Step 1 has two HTTP requests: one GET and one PUT. (Avg time per request 350ms)

  • Step 2 has three HTTP requests: two GETs and one PUT. (Avg time per request 400ms)

The On Complete phase retrieves the failed records from the Object Store to send a notification email with a summary of the flow, and then deletes the Object Store.

The batch process is configured with:

  • Batch block size: 500

  • Max concurrency: 3

  • Scheduling strategy: ROUND_ROBIN

  • Max failed records: -1

  • Accept policy for both steps: ALL

Despite this configuration, the batch takes around 10 hours to process 65,000 records

, which seems excessively long.

How can i make my batch take less time ?

2
  • There is no question in your post, just a statement. You should ask a question. However there is not enough information to help you. Also include in your question: an minimal reproducible example (include flows & batch as XML text), versions of the software used (Java, Mule, Connectors, etc). What did you try? Have you added logs to measure time in each block? Did you use a profiler? How many failed records are in the object store? Did you try commenting components to see if you can identify which one is causing the delay? Please add the information to the question using edit instead of comments. Commented 2 days ago
  • Also read How to Ask on ways to improve the question to increase the chances of getting an answer. Commented 2 days ago

1 Answer 1

0

If you are sending 1 record in a request, then the time taken checks out.

Based on the info you provided, For each record, Batch step 1 takes 700 ms, Batch step 2 takes 1200 ms.
Time taken for each record = 1900 ms / 1.9 second
for 65,000 records it is 123500 seconds or 34 Hours.
With your concurrency setting (3) the process would take around 11 hours.

So the batch is not far from the theoretical performance based on the info you provided

If you are looking to make it faster, I will first advice to see if there is a way to process multiple records in a single request HTTP Request.

If it is not possible, you will need to increase the concurrency based on your vCore size.

If your license allows, you can deploy multiple replicas in a cluster and to increase parallel processing further.

You can also try to make the sequential calls parallel if your business logic allows that.

Be careful when increasing concurrency, confirm that it does not overload the end system or hit any rate limit.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.