How to prevent performance drops caused by heavy scheduled events in Mendix?

0
I have scheduled events running hourly to update data and send notifications. During these runs, users experience performance drops. What's the best way to handle heavy background processing in Mendix?
asked
1 answers
1

Hi Saqlein

When running heavy scheduled events in Mendix, it’s common to see performance drops for users because those events consume server resources. To handle this better, here are some best practices:

 

1. Break Down the Workload:  Instead of running one big scheduled event, split it into smaller chunks or multiple scheduled events that run sequentially or in parallel but consume less resources at a time.

 

2. Use Queues and Batch Processing:   Implement a queue mechanism (using entities to store tasks) and process records in smaller batches within the scheduled event. This reduces the load by spreading processing over time.

 

3. Run Heavy Logic Asynchronously:   Use asynchronous microflows or background processes where possible. For example, trigger sub-microflows that run independently and don’t block the main scheduled event.

 

4. Offload Notifications:   If your scheduled event sends notifications, consider decoupling that from the heavy data processing. You can create a separate event or microflow dedicated just to sending notifications after data processing completes.

 

5. Scale Your Environment:   If possible, scale out your Mendix environment (add more nodes) so scheduled events run on separate instances, reducing impact on user-facing requests.

 

6. Monitor and Optimize:  Use Mendix’s built-in monitoring tools or external APMs (Application Performance Monitoring) to identify slow parts in your scheduled event and optimize queries, loops, or logic accordingly.

 

Regards,

Anurag

answered