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

artificial workflow limit #569

Closed
oliver-sanders opened this issue Mar 26, 2024 · 2 comments
Closed

artificial workflow limit #569

oliver-sanders opened this issue Mar 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@oliver-sanders
Copy link
Member

There's an artificial limit to the number of workflows that will update in the GUI based on the number of cores on the system.

Instructions to reproduce:

  1. Install and start a workflow.
  2. Navigate to it in the tree view.
  3. Leave this workflow running and goto (1).

Repeat the above instructions enough times and you will eventually end up with a workflow that does not update. The tree view will show the initial tasks in the workflow, but the workflow itself could be many cycles ahead of this state.

The number of repetitions of the above instructions required to replicate the bug is the number of virtual CUP cores on your system plus 5.

Cause

We are using a TheadPoolExecutor to manage workflow subscriptions in threads:

self.executor = ThreadPoolExecutor()

self.executor.submit(
self._start_subscription,
w_id,
contact_data['name'],
contact_data[CFF.HOST],
contact_data[CFF.PUBLISH_PORT]
)

But, we don't specify the maximum number of threads so we get the default which is the number of virtual cores on the machine plus 4:

https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor

So on a dual core machine (2 physical cores = 4 virtual cores) the maximum number of workflows that will update is 8! Ouch!

Solutions

  1. Configure a larger number.
  • What's the overheads of lots of threads?
  • Is this a problem?
  1. Stop using threads.
@oliver-sanders oliver-sanders added the bug Something isn't working label Mar 26, 2024
@oliver-sanders oliver-sanders added this to the 1.3.2 milestone Mar 26, 2024
oliver-sanders added a commit to oliver-sanders/cylc-uiserver that referenced this issue Mar 26, 2024
@oliver-sanders oliver-sanders modified the milestones: 1.3.2, 1.4.4 Mar 26, 2024
@wxtim
Copy link
Member

wxtim commented Mar 26, 2024

Replicated on my ol' home laptop. (Ancient processor)

@oliver-sanders oliver-sanders self-assigned this Mar 26, 2024
oliver-sanders added a commit to oliver-sanders/cylc-uiserver that referenced this issue Mar 26, 2024
@oliver-sanders
Copy link
Member Author

Closed by #570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants