Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PERF] Optimize Message Handling in IWorkflowInbox to Reduce Workflow Dispatch Latency #5241

Closed
sfmskywalker opened this issue Apr 18, 2024 · 1 comment · Fixed by #5243
Closed
Milestone

Comments

@sfmskywalker
Copy link
Member

When initiating multiple dispatched workflows concurrently, there is a significant delay before all workflows are processed. This delay appears to stem from excessive messaging within the IWorkflowInbox service, which is tasked with broadcasting events to resume the DispatchWorkflow activity.

Issue Details:

  • During the execution of dispatched workflows, an excessive number of messages are generated.
  • These messages are often unnecessary as they do not correlate with any actionable bookmarks in the database.

Proposed Solution:
To alleviate the processing delay and optimize system performance, we should modify the IWorkflowInbox service to conditionally send messages. Specifically, the service should check for the presence of relevant bookmarks in the database before issuing messages. This change aims to prevent the queue from being filled with redundant messages that do not contribute to workflow processing.

Expected Benefits:

  • Reduced latency in the processing of dispatched workflows
  • Decreased load on messaging infrastructure
  • More efficient resource utilization

This optimization should lead to a more responsive and efficient workflow dispatch mechanism, enhancing overall system performance.

@sfmskywalker sfmskywalker added this to the Elsa 3.2 milestone Apr 18, 2024
Copy link

glime-ai bot commented Apr 18, 2024

To address the issue of significant delays when initiating multiple dispatched workflows concurrently due to excessive messaging within the IWorkflowInbox service, it is indeed necessary to optimize the dispatch mechanism. The proposed solution to modify the IWorkflowInbox service to conditionally send messages only when there are relevant bookmarks in the database is a valid approach. This would prevent the generation of unnecessary messages and reduce the load on the messaging infrastructure.

However, implementing this solution requires careful consideration of the workflow engine's internal mechanisms to ensure that no dispatched workflows are missed and that the system remains reliable. It may involve changes to the way bookmarks are managed and how messages are correlated with them.

Before proceeding with this optimization, it would be important to review the current implementation of the IWorkflowInbox service, the bookmark management system, and the messaging infrastructure to identify the best approach for conditional messaging. Additionally, thorough testing would be required to ensure that the changes do not introduce new issues or negatively impact existing workflows.

If you are looking for guidance on how to implement this change or if you need further assistance with the specifics of the Elsa Workflow system, please provide more details or clarify your requirements.

This comment was generated by Glime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant