Optimizing the Task Manager Performance

Customer and Business Manager automates certain hosting providers' tasks such as creating Plesk accounts and subscriptions, registering domain names, issuing invoices, and so on. To do this, Business Manager uses its own task manager. This task manager does the following:

  • Schedules and runs tasks.
  • Stores task details and execution statuses.
  • Suggests how to resolve possible task execution problems.

If you want to utilize your server resources better, consider optimizing task manager performance in your environment by changing its settings defined in the /opt/plesk-billing/task-manager/config/config.ini configuration file. The paragraphs of this section describe the ways to optimize certain aspects of the task manager.

Reducing Disk Space Consumption

If you want the task manager to consume less disk space, you can reduce the size of its own database. To do this, adjust the following settings that define how much information the task manager stores in the database:

  • How long task manager stores information about processed tasks. The parameters that set these intervals for completed, failed and canceled tasks are completedTasksClearInterval, failedTasksClearInterval, and canceledTasksClearInterval correspondingly.

    By default, these intervals are equal to 1 year. If you want to change them, specify the values in the ISO 8601 standard, for example, P1Y for the 1 year interval.

  • How much information about each task execution is stored. For troubleshooting purposes, the task manager writes information about task executions to log files, one file per each execution. The parameter that sets maximum number of stored log files for each task is the maxTaskLogs. Its default value is 5. To make the logs consume less disk space, specify a smaller value of this parameter.

Note: When you set the task removal intervals described above, remember that setting too small values may make troubleshooting difficult since you may not have enough information about recent task executions.

Increasing Task Manager Performance

When you run all scheduled tasks at once, task manager starts processing a certain number of tasks simultaneously. After completing (or failing to complete) the task, the task manager starts another task from the queue and so on. To make processing of multiple tasks faster, increase the maximum number of tasks processed simultaneously. The parameter that sets this number is runAllMaxInstances.

However, when you set a greater value for this parameter, remember that too big values increase the system load and therefore may reduce the Plesk performance or even block customer access to the Customer Panel.

Increasing Logs Detalization

To make the task manager produce more information that may help you in troubleshooting issues, adjust the logging settings in the following ways:

  • Increase the number of execution logs for each task. To do this, edit the value of the maxTaskLogs parameter. When you set a greater value, remember that this will increase the disk space consumption.
  • Increase the verbosity of the logs. By default, the task manager writes only error information to log files. To get more information on tasks execution, include tasks execution messages into the logs by changing values of the parameters log.info and log.sql to 1.

    Important: Including debug information into the task manager logs will reduce its performance; Therefore, we recommend that you include this information only when you troubleshoot certain issues.