Shopware 6

Shopware 6 - Worker

Shopware 6 is based on Symfony, that should be known to all of us already.
In the article I explain to you that in Shopware 6 tasks are created and how they are processed.

Explanation of the task control

Compared to Shopware 5, we have a the task control control here
As an example I take here the Cache Warmer.

In Shopware 5, bin/console sw:cache:warm was executed and the process itself then performed the warm-up.

In Shopware 6, the bin/console http:cache:warm:up command creates task blocks for the worker to warm up the cache. In this Blackfire trace, we can see what happens:

  ▹ https://blackfire.io/profiles/6fea6b58-3d50-4e05-a4ef-cca77ed7c7bf/graph

The command created messages . The messages are stored in the enqueue table.
In our case, it looks like this:

  ▹ sw6_enqueue_example.txt

Processing the messages

All entries in this table are processed by workers, these are created automaticly in the backend. ¹

Probably this was the easiest way for Shopware, but in practice some massive performance problems occur.

Shopware does not pay attention in any way that not too many workers are active.
If there are a lot of messages, then these are completely shot through without regard to losses.
This has logically to the consequence:

  • Overload of the server
  • Store functionality is limited/not accessible

That's sucked. :/

Conversion of the workers

However, there is fortunately the possibility to run the workers in the background.

  ▹ Setup as Cronjob
  ▹ Setup as service daemon

I recommend doing the conversion on every store.
It has practically already burned servers through it (with this Bug) and even so, I regularly see managed servers that were completely overloaded and customers wondered why the store no longer went.

Documentation


¹ https://community.hetzner.com/tutorials/install-shopware-6#step-6---configuring-background-queue-worker