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!
Solved! Go to Solution.
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 ],
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 ],