Shopware processes all tasks asynchronously by default. This has the advantage that important processes can be processed independently of undesired timeouts or system crashes. All tasks that are processed asynchronously are located in the so-called message queue.
In Shopware 6, the message queues in the administration are processed completely automatically in the background by the so-called "Admin Worker". Among other things, this makes it possible to work very quickly in the admin.
However, this method requires the Administration to be open for a longer period of time. If a large number of users are logged into the administration, the CPU load can become very high. This can disrupt the smooth execution of the message queues. In such cases, it is advisable to switch off the admin worker and let the processes run via the CLI. In this way, tasks are also completed when no one is logged into the administration and a high CPU load caused by several users is also avoided. This approach is particularly useful for larger shops.
To do this, follow these steps to deactivate the Admin Worker.
The deactivation of the admin worker is not provided for in the Shopware standard, which is why manual adjustments must be made at server level. If in doubt, it is best to contact your hoster.
To disable the admin worker you have to make the change in the shopware.yaml file. You can find it in your Shopware installation under config/packages/. Disable the admin worker with " false " and save the file.
# config/packages/shopware.yaml shopware: admin_worker: enable_admin_worker: false
Now execute the following commands one after the other via CLI.
bin/console messenger:consume default --time-limit=60
bin/console scheduled-task:run --time-limit=60
We recommend time-limit=60 for the above commands, so that the command is executed for a maximum of 60 seconds. Alternatively, you can define a memory limit instead of a time limit. You can find more information in our developer documentation.
It is important that the commands are executed regularly so that the message queue is continuously processed. This can be done, for example, by creating a cron job on the server. Contact your hoster for this.