Adobe Commerce Cloud Performance Optimization

Guest author: Anshuman Ravi (Twitter / Github)

Adobe Commerce Cloud Performance overview

Adobe commerce cloud formerly Magento is a powerful feature packed E-commerce platform. Its core “commerce” package contains almost all standard features for B2c and B2B merchants out of the box, and then on top of it there is a vibrant community of third-party extension providers along with Adobe commerce official extension marketplace.
With all those out-of-the-box features, Adobe commerce core package has turned out to be a monolithic application, if not set up properly, merchants using Adobe commerce often face performance and scalability issues.

Following Adobe's acquisition of Magento, existing Magento users turned to Adobe's cloud-based platform. According to Quora discussions Magento commerce powers 250,000 online stores.

One of the main culprits for performance issues on Adobe commerce applications in my experience is custom code either developed by the in-house development team or from a third-party extension vendor, Which does not follow best practices and results in unusual resource consumption, memory leak and database bottlenecks.
Some of the common mistakes are invoking database queries in loop or poorly designed database table schema for custom tables :

Example of a non optimized code 

//Avoid below: 

foreach ($orderIds as $orderId) {

    $order = $this->order->load($orderId);

    if(in_array($order->status(),$this->_orderConfig->getVisibleOnFrontStatuses())){

        $validOrder[] = $order

    }

}

An alternative better code:

// Use filter instead to avoid multiple load of order object from database

$collection = $this->_orderCollectionFactory()->create($customerId)

        ->addFieldToSelect('*')

        ->addFieldToFilter('status',

            ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]

);     

EAV Table Structure of Adobe Commerce

Magento (Adobe commerce) uses EAV table structure for storing catalog and customer information for fine-grained flexibility, which is good, but every good thing comes with a price, isn’t it 😊, Using EAV table structure makes SQL queries on Adobe commerce complex, While out of the box Adobe commerce SQL queries are fairly optimized, the problem may occur when custom code or extension adds changes on top of it to implement custom features which often result in not-so-optimized database SQL queries and that results in database bottlenecks impacting storefront.

Tools for optimizing Adobe Commerce

Thankfully there are some tools available both free and paid which could help in identifying such performance issue, tools like xhprof and Blackfire profiler could help in identifying areas which needs to be improved and if it is indeed a Database bottleneck, EverSQL as I recently found out, is an amazing tool to get detailed information and next steps on resolving it.

EverSQL

EverSQL enables you to identify slow queries and automatically rewrite them, without the need to be a SQL expert. It also helps you to identify missing indexes which can provide a quick solution for a performance challenge.

EverSql Optimization for Adobe Commerce Cloud

 

Some other root causes for performance issues on Adobe commerce platform are limited server infrastructure (For on Premise Adobe Open source platform ) and front-end related performance issues, I believe continuous monitoring and optimization are key in keeping your Adobe commerce platform optimized.

Adobe Performance Monitoring Tools

Adobe commerce cloud customers could use Adobe official monitoring tools related to site performance, such as Memory usage, CPU load, and general site availability Monitoring. There are third-party solutions available as well for custom monitoring such as EverSQL Sensor for database performance monitoring and sentry, Azure application insight and others for frontend application performance monitoring.

Adobe Commerce Cloud Performance Alerts

Managed alerts are available if you have Adobe Commerce on cloud infrastructure Pro plan architecture. The Apdex and error rate alerts are the only ones you'll receive if you're an Adobe Commerce Starter plan architecture customer.

You can use third-party tools like EverSQL to gain application performance alerts regarding your database status.

Here is a list of all the manager alerts you can get from Adobe Commerce on cloud infrastructure Pro plan:

  • Managed alerts for Adobe Commerce: CPU warning alert
  • Managed alerts for Adobe Commerce: CPU critical alert
  • Managed alerts for Adobe Commerce: memory warning alert
  • Managed alerts for Adobe Commerce: memory critical alert
  • Managed alerts for Adobe Commerce: Apdex warning alert
  • Managed alerts for Adobe Commerce: Apdex critical alert
  • Managed alerts for Adobe Commerce: disk warning alert
  • Managed alerts for Adobe Commerce: disk critical alert
  • Managed alerts on Adobe Commerce: MariaDB alerts
  • Managed alerts on Adobe Commerce: Redis memory warning alert
  • Managed alerts on Adobe Commerce: Redis memory critical alert