Tune MySQL / mariadb database for WooCommerce and WordPress

WooCommerce can really give mysql or mariadb a pounding.

On smaller hosting platforms WooCommerce will grind to a halt.

If you have a VPS, here are a few things you can tune, to give you fast database performance. The faster the database goes, the faster WooCommerce goes:

 

InnoDb cache

Assuming of course that you’re using innodb (which is a must – see below)

innodb_buffer_pool_size=1024M

The size should be as large as your wp_postmeta and wp_options tables, or 50% or more of your WooCommerce database. Don’t go above 25% of the RAM in your VPS.

 

Query Cache

There are a few articles out there saying disable query cache , but I think it really helps the WordPress wp_options table, which WooCommerce stores most of its data in.

query_cache_limit=2M

query_cache_size=64M

query_cache_type=1

If you have a lot more memory in your VPS, try this:

query_cache_limit=8M

query_cache_size=256M

query_cache_type=1

 

Make sure you’re using innodb

Innodb is the fastest and most reliable database engine for mysql , mariadb, WordPress and WooCommerce. Here’s how to check.

  • Login to PHPMyAdmin
  • Select the database for your WP site.
  • Click the SQL tab.
  • Type this:   show table status
  • Click GO.

You are looking for engine and you want InnoDB.

If it’s myisam you need to fix it. Use this command in PHPMyAdmin (as above). make sure you have a good backup first.

  • ALTER TABLE tablename ENGINE = InnoDB
  • you’ll need to it for each table that was myisam  (replace tablename with each table)
  • 7 Users Found This Useful
Was this answer helpful?

Related Articles

How to create a .ppk from private key on Windows

Using a Public/Private key to authenticate when logging into SSH can provide added convenience or...

Connecting using SSH on Linux or OSX workstations

Use the ssh command to connect to your instance. Specify your username and the external IP...

How to connect to MySQL (Web interface & CLI)

Web Interface Adminer is a database management web applicarion URL :...

How to connect to Cloud Application shell (Web interface & CLI)

Web based command line URL :  https://12.34.56.789:12320/User : root SSH Login as root....

What is Reverse DNS?

Reverse DNS (rDNS) is name resolution that looks up an IP addresses to obtain a domain name,...