elsa-workflows / elsa-workflows/elsa-core
Optimize SignalR Broadcasting in Realtime Workflows to Enhance Performance
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
When the "realtime workflows" feature is active, a SignalR hub facilitates connections from Elsa Studio applications to receive updates on running workflow instances. This feature is useful for real-time monitoring but has been identified as a potential performance bottleneck, particularly under heavy workflow execution loads. The current implementation involves broadcasting workflow status changes and execution log entries directly from the workflow execution thread, which has been pinpointed as a hotspot during profiling.
### Objective
The goal is to investigate and implement more efficient methods for handling SignalR broadcasting to mitigate any adverse effects on workflow execution performance. One proposed strategy is to offload SignalR interactions to a background task, thereby decoupling the broadcasting process from the workflow execution thread.
### Expected Outcome
- Improved performance of the system, especially under heavy load, by eliminating bottlenecks associated with real-time updates broadcasting.
- Seamless real-time updates experience in Elsa Studio without compromising workflow execution efficiency.
### Steps for Investigation/Implementation
1. Profile the current implementation to quantify the impact of SignalR broadcasting on workflow execution performance.
2. Explore the feasibility of handling SignalR broadcasts in a background task or using alternative efficient approaches.
3. Implement the chosen solution and conduct performance comparisons to ensure that the issue is resolved.
Contributor guide
Assessment
This issue has not been assessed yet.