Skip to content

Parallelized service starting and stopping tasks - #4

Open
Michael-Hollister wants to merge 1 commit into
devture:mainfrom
Michael-Hollister:feature/parallelize-service-starting-stopping
Open

Parallelized service starting and stopping tasks#4
Michael-Hollister wants to merge 1 commit into
devture:mainfrom
Michael-Hollister:feature/parallelize-service-starting-stopping

Conversation

@Michael-Hollister

Copy link
Copy Markdown

Following up from parallelizing some of the tasks in the matrix-docker-ansible-deploy playbook, I have added the option to start/stop services asynchronously. Here are the following benchmarks when using this feature in the matrix-docker-ansible-deploy playbook:

Benchmarks

start-all

Number of Services Before (synchronous) After (async)
45 3m 2s 1m 29s (51% improvement)
123 8m 42s 5m 45s (34% improvement)

stop-all

Number of Services Before (synchronous) After (async)
45 1m 56s 53s (54% improvement)
123 6m 28s 4m 10s (35% improvement)

Ansible controller CPU: Ryzen 5900X

Also observed faster results by using more jobs for the host configuration using 123 services, but the results above used the default value of devture_systemd_service_manager_parallel_jobs: 16

Comments

I have left this feature disabled by default however for the following reasons:

  • Don't know if Window's shell support is required for this role (xargs usage)
  • Easier debugging of task failure with parallelization turned off
  • Strict priority starting/stopping ordering is not followed since services are started/stopped in parallel. I did test implementations that respected service priority for starting/stopping services, but its slower and more complex code-wise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant