cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4 MySQL Connections Usage

SOLVED

Magento 2.4 MySQL Connections Usage

Hello,

 

I am using Magento 2.4 on AWS and I have been noticing that there are many MySQL connections in sleep, is this normal? Should I be looking into this to fix it, if yes then where can I look to fix this? 

 

This website is running one store with around 80+ products and these processes are in there when there's no user on the website too!

 

1.png

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.4 MySQL Connections Usage

Whoever's been having this problem, its because of stuck consumer runner cron jobs waiting for max messages to be reached. Please see the following article, this fixed my problem:

https://www.cadence-labs.com/2020/03/magento-2-stuck-or-long-running-cron-after-upgrade-to-2-3-x/

I'm using Magento 2.4.0 and by default it was waiting to reach max messages limit, so I changed the parameter consumers_wait_for_messages in env.php to 0 as mentioned in the blog and now the cron job does not wait for max messages to be reached and closes the database connection.

'queue' => [
    'consumers_wait_for_messages' => 0
],

Ref: https://devdocs.magento.com/guides/v2.4/config-guide/prod/config-reference-envphp.html#consumers_wai...

View solution in original post

1 REPLY 1

Re: Magento 2.4 MySQL Connections Usage

Whoever's been having this problem, its because of stuck consumer runner cron jobs waiting for max messages to be reached. Please see the following article, this fixed my problem:

https://www.cadence-labs.com/2020/03/magento-2-stuck-or-long-running-cron-after-upgrade-to-2-3-x/

I'm using Magento 2.4.0 and by default it was waiting to reach max messages limit, so I changed the parameter consumers_wait_for_messages in env.php to 0 as mentioned in the blog and now the cron job does not wait for max messages to be reached and closes the database connection.

'queue' => [
    'consumers_wait_for_messages' => 0
],

Ref: https://devdocs.magento.com/guides/v2.4/config-guide/prod/config-reference-envphp.html#consumers_wai...