WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So far I've got around 8,000 products in my WooCommerce and the product page on the front end takes several seconds to load, even after caching.

My VPS host says that I should have multiple databases.
Is that the right method and if so, how is it possible?

Any suggestions on speeding up my database queries or simply speeding up the front end would be great.

share|improve this question

closed as off-topic by Pieter Goosen, toscho Jul 23 '14 at 17:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

This is really a server question and not particularly Wordpress.

You're running into a MySQL server speed bottleneck at 1and1. Sorry, but they're well known as a slow shared host, and for that reason I doubt their VPSs are any better.

Caching and a CDN will only do so much for you. You need more horsepowwer in the form of a better and faster MySQL server, and if you're already paying for a VPS, move to a better VPS host, like Media Temple.

Once there, with root access, you can use a utility such as http://mysqltuner.com to log and analyze the performance of the MySQL server and adjust server memory and database query cache parameters in the configuration file my.cnf. You will also be able to adjust apache - in httpd.conf - to handle high loads.

There is little sense in trying to optimize the database queries made by Woo Commerce or Wordpress; any changes made will need to be made again after updates.

share|improve this answer
I'm trying out WP Super Cache, didn't help to much. I trust you on the server but 1and1 claims its the sites code, could you look at it really quick and confirm? s15430161.onlinehome-server.com/shop/product-category/… just click on one of the various comic thumbnails. Oh and currently there are about 13,000 products in the db. – Stephen Oct 30 '12 at 17:39
@ the comment above, I cached a few of them, so if it loads instantly try a different one. – Stephen Oct 30 '12 at 17:58
Forget trying to cache. If you have root at that VPS, check your my.cnf file and run mysqltuner.pl to tune MySQL. – markratledge Nov 1 '12 at 4:31
It's not a MySQL bottleneck - it's down to some terrible coding inside Woocommerce and Wordpress which parses through every product in your database using PHP just to count products in each category. The mysql for 100,000 products on a server of mine returns in 0.3 seconds but using basic PHP-FPM the page takes 185 seconds to return (8 core VPS!). When I use HHVM instead, it's 10 seconds. – Dave Hilditch Jan 14 '15 at 23:23

I have two solutions which I would suggest which should resolve your problem. Turn to the use of elasticsearch.com to populate all product indexes. At the same time you dramatically improve the search capabilities of your website (if integrated correctly). I would make sure to place the elasticsearch solution on a different server.

My thoughts are that your caching system is not setup correctly or your server is overloaded. A solution which might be the cheapest (option #2) would be to use the free caching servers from cloudflare.com. This typically will fix your problem in the most cost effective way if you dont want to deal with server optimizations.

share|improve this answer

Caching with Varnish is the best solution, however you must avoid caching the header cart snippet and the cart/checkout pages. I think that WooCommerce should be configured with Varnish Edge Side Includes. To exclude checkout Follow these instructions:


share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.