Spoiler: WPSOLR powers real 500K products WooCommerce sites !
You can find some WooCommerce sites equipped with our Elasticsearch or Solr plugin, raging from 100,000 to 500,000 products. Surprisingly, on rather modest WordPress hosting plans.
- 500K products for OEM+ Performance – WooCommerce Tuning Parts: https://www.oemperformance.com/home/?s=&post_type=product
- 400K products for Bladmuziek PLUS – WooCommerce Music Sheets: https://www.bladmuziekplus.nl/
The 1 million products WooCommerce
There is a lot of interest for a 1 million products real-life WooCommerce. Just search on Google. But strangely, there are no definitive answer. And even less answers on how much WooCommerce can take.
Before to start, we should notice that in most (almost?) answers from the community, some topics are never mentioned:
– Hard limits
– Soft limits, especially search
– Cost of adding more hardware resources
– Showcase of live WooCommerce sites with large amounts of products
For instance, this Automattic answer to the “1 million products WooCommerce” does not mention hardware, search, costs, or live examples.
We will begin to answer these problems in this post, and even show some real-life WooCommerce shops.
WordPress hard limit
The hard limit of WooCommerce is that WordPress is not a distributed CMS.
WordPress is (a lot of) PHP code with a MySQL database. But MySQL is not a distributed database like Cassandra: it cannot be distributed on several machines to support more load.
So, there is a hard limit on WooCommerce, which is how much RAM and CPU and disk you can put on a single machine. Disk can be distributed. But not RAM or CPUs. Therefore, you cannot scale WooCommerce by adding more hardware.
Tricks to help
Of course, you can use some tricks to help. For instance, using Memcached or Redis to distribute the RAM on several machines. But is is only improving caching, and as soon as some new queries are called, MySQL will be serving results and will have some hard time.
You can also add some clustering to MySQL. But again, it will only help for a while.
So, let say you can add as many products as one server RAM and CPUs can serve. A few tens of millions perhaps.
WordPress soft limit
Then, another major problem will kill your WooCommerce anyway: search.
Both search and dynamic filtering are not the cup of tea of MySQL.
And according to my own experience, you cannot then go much further than a few thousand products.
SQL is not meant to deal with full-text search, and dynamic filtering on a normalized database implies a lot of scan table reading.
This is especially true with WordPress “post_meta” table inner joins. This is the “orders” issue mentioned by the Automattic team on Automattic answer to the “1 million products WooCommerce”. Even the internal post type search in the admin can be completely stuck. For instance, searching an order by a client’s email or zip code is scanning the order meta custom fields (and there are a lot!).
So, a few tens of millions products on a single server, but a few thousands only due to limited search capabilities that all visitors expect (think of Amazon search and filters)?
Search engines to overcome soft limit
Well, you can overcome the search issues, by using a full-text technology. Like Elasticsearch or Apache Solr, both based on Lucene.
By nature, they can cope with full-text search. After all, they have been built for that (thanks to their inverted index).
And they can also be distributed to scale linearly by adding cheap hardware (adding more RAM, CPUs, and disk at the same time).
From what I’ve experienced, with Elasticsearch, the hundred of thousands of products, even millions, is not a problem anymore. And probably WooCommerce can even achieve much more on a more expensive machine with lots of RAM and CPUs.