skip to Main Content

We have two magento 2 projects on same server the abc.com and xyz.com

when i run this command –

php bin/magento queue:consumers:start product_action_attribute.update --single-thread --max-messages=10000

output – Consumer with the same name is running

when i run this commands – ps aux | grep -i [c]onsumer

abc   11452  0.0  0.0 492568 71128 ?        S     2020  34:11 /opt/severname/php/7.3/bin/php /var/www/vhosts/abc.com/httpdocs/bin/magento queue:consumers:start product_action_attribute.website.update --single-thread --max-messages=10000
abc   11454  0.0  0.0 492572 71180 ?        S     2020  34:02 /opt/severname/php/7.3/bin/php /var/www/vhosts/abc.com/httpdocs/bin/magento queue:consumers:start exportProcessor --single-thread --max-messages=10000
abc   11456  0.0  0.0 492568 71084 ?        S     2020  34:08 /opt/severname/php/7.3/bin/php /var/www/vhosts/abc.com/httpdocs/bin/magento queue:consumers:start inventory.source.items.cleanup --single-thread --max-messages=10000
abc   11460  0.0  0.0 492568 71176 ?        S     2020  34:04 /opt/severname/php/7.3/bin/php /var/www/vhosts/abc.com/httpdocs/bin/magento queue:consumers:start inventory.reservations.cleanup --single-thread --max-messages=10000
abc   11462  0.0  0.0 492568 71064 ?        S     2020  34:08 /opt/severname/php/7.3/bin/php /var/www/vhosts/abc.com/httpdocs/bin/magento queue:consumers:start inventory.reservations.update --single-thread --max-messages=10000
abc   11464  0.0  0.0 492568 71076 ?        S     2020  34:12 /opt/severname/php/7.3/bin/php /var/www/vhosts/abc.com/httpdocs/bin/magento queue:consumers:start codegeneratorProcessor --single-thread --max-messages=10000
abc   11546  0.0  0.1 498712 77548 ?        S    Jan28   2:01 /opt/severname/php/7.3/bin/php /var/www/vhosts/abc.com/httpdocs/bin/magento queue:consumers:start product_action_attribute.update --single-thread --max-messages=10000
xyz+ 12946  0.0  0.1 505936 83260 ?        S    Jan26   3:01 /opt/severname/php/7.3/bin/php /var/www/vhosts/xyz.com/httpdocs/bin/magento queue:consumers:start inventory.mass.update --single-thread --max-messages=10000

the issue is that i am unable to update bulk product attributes in xyz.com but able to update bulk product attributes in abc.com

can anyone know how to solve this ?

2

Answers


  1. if you have such a issue then do you consumer process using cron

    'cron_consumers_runner' => [
            'cron_run' => true,
    

    it will solve your problem

    Login or Signup to reply.
  2. I would assume the crux of the problem has to do with the way your Magento instances are setup on the server and the fact that consumers only allow a single thread by default, but it’s hard to know without knowing more about the setup itself.

    A possible solution (but not the most ideal in my opinion) would be to prevent the consumers from remaining alive if no messages are available to consume, this would prevent them from overlapping:

    'cron_consumers_runner' => [
        'cron_run' => true
    ],
    'queue' => [
        'consumers_wait_for_messages' => false
    ]
    

    Further to that in Magento 2.4+ the consumers will only spawn if there are messages to consume.

    Another option would be to allow one or both of the sites to spawn multiple threads. For example try to remove that --single-thread option from the command and it would likely run and spawn the consumer as it’s skipping the check. You can add this to your env.php to have both of these measures in place and it will probably suffice:

    'cron_consumers_runner' => [
        'cron_run' => true,
        'single_thread' => false
    ],
    'queue' => [
        'consumers_wait_for_messages' => false
    ]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search