Configure the task execution engine

In XL Deploy, deployment tasks are executed by dedicated worker instances. An XL Deploy master generates a deployment plan that contains steps that an XL Deploy worker’s task execution engine will carry out to deploy an application. You can read more about masters and workers here

Tuning the task execution engine

You can tune the XL Deploy workers’ task execution engine with the following settings in XL_DEPLOY_SERVER_HOME/conf/xl-deploy.conf:

Setting Description Default
task.shutdown-timeout Time to wait for the task engine to shut down. 1 minute
task.max-active-tasks Maximum number of simultaneous running tasks allowed in the system. If this number is reached, the tasks will appear as QUEUED in the Monitoring section. Each QUEUED task will automatically start after a running task completes. 100
task.recovery-dir Name of the directory in XL_DEPLOY_SERVER_HOME where task recovery files are stored. work
task.step.retry-delay Time to wait before rerunning a step that returned a RETRY exit code. 5 seconds

You can configure the thread pool that each worker has available for step execution in XL_DEPLOY_SERVER_HOME/conf/xl-deploy.conf:

Setting Description Default
task.step.execution-threads Amount of threads in the pool. 32

Important: Threads are shared by all running tasks on a worker; they are not created per deployment.

Task execution example

The following example illustrates how you can adjust the task.step.execution-threads setting to impact task execution.

Note: This example assumes that no other tasks are active in the system, and uses the out-of-the-box internal worker setup. Note that this is not a production setup. This example is only for illustration purposes.

Assume there is an application that contains six deployables, all of type cmd.Command. Each one is configured with a command to sleep for 15 seconds.

In XL_DEPLOY_SERVER_HOME/conf/xl-deploy.conf, set the step.execution-threads property to 2:

task.step.execution-threads=2

Restart the XL Deploy server so the settings take effect.

After the server starts, set up a deployment of the application to an environment. In the Deployment Properties, set the orchestrator to parallel-by-deployed. This ensures that the deployment steps will be executed in parallel. Your deployment will look like:

Sample deployment plan with parallel-by-deployed orchestrator

Click Execute to start the execution. Because the core pool size is 2, only two threads will be created and used for step execution. The XL Deploy execution engine will start executing two steps and the rest of the steps will be in a queued state:

Deployment with limited core pool size

Because you set the step.execution-threads property to 2, a maximum of two steps are executed at a time. After the first two steps are executed, the next two steps will be picked for execution until all tasks are complete.