Need help?

Our experts have had an average response time of 12.14 minutes in September 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

How to Optimize Magento Database to improve site speed

by | Mar 14, 2021

Wondering how to Optimize Magento Database to improve your website speed? We can help you.

Ensuring that our e-commerce solution is running fast is one of the most important factors to the sales.

SEO rankings, abandonment rate, and the shopper’s overall user experience are also as important as the speed of the website.

Here at Bobcares, we often handle requests to optimize Magento database as a part of our Server Management Services.

Today let’s see how our Support Engineers do this for our customers.

How to Optimize Magento Database

The following steps can be used to Optimize Magento database.

1. MySQL table optimization

Through phpMyAdmin, we can perform the command OPTIMIZE TABLE on specific Magento database-tables. When a table is cluttered, this could lead to improvement of performance. This does not only count for the complex EAV-tables, but also for regular MySQL tables frequently in use (for instance, core_config_data).

2. MySQL server tuning

The default MySQL setup is a lot of times sufficient to run a general hosting environment, but not all optimized for Magento. Tuning settings like query_cache_size could dramatically increase performance but is also dangerous because it hugely depends on other variables (number of databases, number of tables per database, number of queries, peak usage).

3. Log cleaning

Magento maintains several tables for logging. These tables log things such as customer accesses and frequently-compared products. Magento has a mechanism for cleaning these logs regularly, but this feature is disabled by default and most customers do not enable it.

4. Query Cache size

Modify the configuration of the MySQL server to take better advantage of the server’s RAM. Most Linux distributions provide a conservative MySQL package out of the box to ensure it will run on a wide array of hardware configurations. If we have ample RAM (eg, 1gb or more), then we can try tweaking the configuration. An example of my.cnf is below. However, will have to consult the MySQL documentation for a complete list of configuration directives and recommended settings.

Query Cach: query_cache_size: 64MB, query_cache_limit: 2MB
query_cache_type = 1
query_cache_size = 32M

Recommended innodb_buffer_pool_size.
Combined web and db server, 6 GB RAM: 2-3 GB
Dedicated database server, 6GB RAM: 5 GB
Dedicated database server, 12 GB RAM: 10 GB

2 * [numberofCPUs] + 2

5. Setup Faster Hardware for Server Hosting

SSD for databases

 [Need assistance to Optimize your Magento? – We can help you]


In short, eCommerce customers expect a website to load within 2 seconds. Today we saw how our Support Techs do Magento speed optimization using open-source software.


Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.


var google_conversion_label = "owonCMyG5nEQ0aD71QM";


Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center


Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]


Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid


Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie


These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.