How to Speed Up WooCommerce on a Small VPS Without Upgrading
A WooCommerce store on a 1 or 2 GB VPS can feel slow long before it runs out of visitors. Most of the time the fix is not a bigger plan. It is a handful of settings and cleanups that remove work your server repeats on every page load. This guide walks through how to speed up WooCommerce small VPS stores step by step, starting with measurement so you fix the real bottleneck first.
Measure First: Find the Real Bottleneck
Guessing wastes time. Before you change anything, record a baseline. Note the load time of your home page, a product page, and the checkout page. Use your browser’s developer tools or a free speed test, and write the numbers down with the date. Then check the server side: run htop while loading a product page and watch whether CPU, RAM, or disk I/O spikes first. If RAM is the limit, caching helps most. If CPU spikes, PHP or a heavy plugin is usually the cause.
Install Query Monitor on a staging copy of the site, not on the live store, and load a slow page. It shows which queries take longest and which plugins fire the most hooks. One slow query from a related-products widget can cost more than every image on the page combined. Fix what the numbers point at, then measure again after each change so you know which fix actually helped.
Speed Up WooCommerce Small VPS Stores With Object Caching
WooCommerce builds most pages from database queries: prices, stock levels, product attributes, cart contents. Without object caching, the same queries run again for every visitor. A woocommerce object cache stores those results in memory, so repeat queries return in a fraction of the time.
On Ubuntu, install Redis and the PHP Redis extension:
sudo apt install redis-server php-redis
sudo systemctl enable --now redis-server
Then install the Redis Object Cache plugin, activate it, and click Enable Object Cache in its settings. Check that the plugin reports a connection before you move on. A store that shows “connected” in the plugin but still loads slowly usually has the cache working and a different bottleneck, so go back to your measurements. The full setup is covered in the Redis object cache guide for WordPress on a VPS.
One warning: object caching helps product and category pages, but it does not cache full pages by itself. It also does nothing for the cart or checkout, which must stay dynamic. That is the next step.
Cache Pages, But Never Cart, Checkout, or Account Pages
Full-page caching is the single biggest win for a small VPS. A woocommerce page cache serves a cached product page straight from disk or memory without touching PHP or MySQL at all. Nginx FastCGI cache does this without a plugin, and it costs almost no RAM.
The catch is that WooCommerce pages must never be cached. A cached cart shows one shopper another shopper’s items. A cached checkout can leak personal details. Exclude these paths in your Nginx config:
set $skip_cache 0;
if ($request_uri ~* "/cart/|/checkout/|/my-account/") {
set $skip_cache 1;
}
if ($http_cookie ~* "woocommerce_items_in_cart|wp_woocommerce_session") {
set $skip_cache 1;
}
Use the $skip_cache variable in your fastcgi_cache_bypass and fastcgi_no_cache directives, then test by adding a product to the cart and confirming the cart count changes on the next page. If the count stays stale, your exclusion is wrong and you must fix it before going live. The same care applies to checkout speed itself, which has its own traps; the WooCommerce checkout speed guide covers them in detail.
| Page type | Cache it? | Why |
|---|---|---|
| Home, shop, product, category | Yes | Same content for every visitor |
| Cart | No | Contents differ per shopper |
| Checkout | No | Personal and payment data |
| My Account | No | Order history is private |
| Blog posts and pages | Yes | Static content, safe to serve from cache |
Clean the Database: WooCommerce Database Cleanup That Matters
A WooCommerce database grows fast. Every order creates rows, every product edit leaves a revision, and expired transients pile up in wp_options. On a small VPS with limited RAM, a bloated database means slower queries and a MySQL process that eats memory.
Start with the safe wins. Delete post revisions older than a month, clear expired transients, and remove orphaned postmeta rows left behind by deleted products. WP-CLI does this without a plugin:
wp transient delete --expired
wp post delete $(wp post list --post_type=revision --format=ids) --force
Back up the database first. A delete you cannot undo is worse than a slow site. For a deeper pass, including wp_postmeta bloat from old plugins, follow the WooCommerce database and query optimization guide, and the revisions and transients cleanup walkthrough for the exact commands.
Check the slow query log after cleanup. If one query still dominates, add an index to the column it filters on, or replace the plugin that issues it. Cleaning once is not enough either: put the transient cleanup in a weekly cron job so the database stays lean instead of drifting back to the same state in a month.
Shrink Images and Serve WebP
Product photos are usually the largest files a store serves. A 2 MB photo uploaded straight from a phone forces every visitor to download 2 MB, and a category page with 12 of them becomes a 24 MB page. To optimize woocommerce images, resize them to the largest size your theme actually displays, usually no wider than 1200 pixels for a product image, and convert them to WebP.
The cwebp command line tool converts a whole uploads folder in one pass:
find wp-content/uploads -name "*.jpg" -exec cwebp -q 82 {} -o {}.webp ;
Then configure Nginx to serve the WebP file when the browser accepts it, and keep the original as a fallback for older browsers. Regenerate thumbnails after changing image sizes so WordPress stops serving the full-size original in product grids. Lazy-load images below the fold so the first screen paints before the rest of the gallery even starts downloading.
Tune PHP: OPcache and PHP-FPM Settings
PHP compiles your code on every request unless OPcache is on. With OPcache enabled, PHP stores the compiled code in memory and skips that work. On a small VPS this is free speed, and it takes one config change.
Check that OPcache is active:
php -i | grep -i opcache.enable
If it reports off, enable it in your PHP ini file and restart PHP-FPM. Keep the OPcache memory modest, 64 to 128 MB is plenty for a single WooCommerce site, and set a revalidate frequency so code changes still take effect without a manual restart. The OPcache settings guide for WordPress on PHP and Ubuntu lists settings that fit a low-memory VPS.
Next, tune PHP-FPM. The default pm.max_children is often too high for 1 to 2 GB of RAM, and too many children will push the server into swap, which is slower than queuing a request for a moment. As a starting point, set pm = dynamic, pm.max_children to roughly your free RAM divided by 50 MB per child, and pm.start_servers to half of that. Watch memory under load for a day and adjust.
Audit Plugins and Keep Measuring
Plugins are the most common cause of a slow WooCommerce store. Each active plugin adds code to every request, and some add database queries to pages that do not need them. Deactivate plugins one at a time on staging and measure the product page after each one. A plugin that adds half a second to every page is worth replacing or removing, even if you like its features.
Be strict about overlap. Two SEO plugins, two caching plugins, or three slider plugins doing the same job is a sign the install has drifted. Keep one tool per job. Delete deactivated plugins instead of leaving them installed, since their files still get scanned on some requests and their settings still sit in the database.
Finally, repeat your baseline test. Load the same three pages you measured at the start and compare. If the home page is faster but checkout is not, your page cache is working and your checkout bottleneck is elsewhere, which is useful information, not a failure. Write the new numbers next to the old ones and keep them. The next time the store feels slow, you will know whether it actually got slower or whether traffic simply grew, and you will know exactly which fix to repeat.