MySQL Deadlocks with Magento

One of the things that Magento, and specifically the Zend Framework provide developers is the ability to not have to think about database details as it should just handle all that for you. When it becomes obvious that there is a problem somehow with the production database getting some sort of SQL errors, its time for the developers to start caring about the implementation and architecture details of the database.

Symptoms

One of the indicators of upcoming troubles is that your admin users start to get error messages saying that there are deadlocks in the transactions. At first, these errors are extremely sporadic and hard to track down. Over time and increased traffic loads, they will become more frequent to the point that it requires attention.

Fortunately, there is a relatively new Magento extension that enables you to replay the deadlock transactions until they run successfully so that you can get your site back to running properly. While this is not a permanent fix for your issues, as it will slow the site while doing certain actions, it does make the errors stop so that you can fix the root issue. This extension is the Philwinkle_DeadlockRetry . I have taken a look at the code and it looks fairly safe, but have not used it in any of my sites, so be careful about deploying it to a busy production site.

comments powered by Disqus

Related Posts

Creating a Best-Sellers Category with Magento

Magento allows you to organize products in categories, and a single product can be a member of quite a few separate categories. As a result, you can create a category that is specifically for your top selling products. You could manually keep track of which products sell the best, either by number of sales completed, or by the actual quantity of each product that were sold. If you want to spend all your time managing this category, then this is the way to go.

Read More

Magento FrontName Naming and SSL/HTTPS

One of the things that has always been an issue for sites that are based on Magento is that they are slow. Well, to be fair, sites using Magento Enterprise Edition that take advantage of the built-in full-page caching functionality seem to have decent page load times. One way to take care of this slow load time issue is to utilize a third-party full-page caching solution such as what Varnish provides.

Read More

Magento Cache with Cache Disabled

One of the things that I find quite annoying with a web platform is when you configure it to do one thing, and it does something different. Magento is an eCommerce software platform that many of the leading eCommerce websites use for their web stores. Magento Magento comes in two different flavors, a paid enterprise edition as well as a open-source community edition. The enterprise edition allows you to utilize the built-in full-page caching mechanism, while the community edition does not include a full-page caching solution.

Read More