LoadForge LogoLoadForge

PrestaShop Load Testing: How to Load Test PrestaShop Stores with LoadForge

PrestaShop Load Testing: How to Load Test PrestaShop Stores with LoadForge

Introduction

PrestaShop load testing is essential if you want your online store to stay fast and stable during product launches, seasonal promotions, flash sales, and holiday traffic spikes. As an e-commerce platform, PrestaShop handles a mix of dynamic and static workloads: homepage browsing, category filtering, product detail pages, cart updates, customer login, and the all-important checkout flow. Even if your store feels fast with a few users, performance issues often appear when hundreds or thousands of shoppers interact with the same inventory, sessions, and payment steps at once.

With LoadForge, you can run realistic cloud-based load testing and performance testing scenarios for PrestaShop using Locust-based Python scripts. That means you can simulate anonymous shoppers, returning customers, cart activity, and checkout workflows from global test locations while monitoring real-time reporting. This is especially useful for stress testing your PrestaShop store before major campaigns and for integrating performance checks into your CI/CD pipeline.

In this guide, you’ll learn how to load test PrestaShop stores with realistic user behavior, how PrestaShop behaves under load, and how to interpret your results to improve store performance.

Prerequisites

Before you begin load testing PrestaShop with LoadForge, make sure you have:

  • A running PrestaShop store in a staging or pre-production environment
  • The base URL of your store, such as https://shop.example.com
  • A few valid product URLs or product IDs
  • At least one test customer account
  • A checkout flow you can safely test without charging real payments
  • Knowledge of your theme and modules, especially:
    • layered navigation / faceted search
    • checkout modules
    • payment gateway integrations
    • shipping modules
    • custom cart or loyalty features

You should also confirm:

  • Caching is configured similarly to production
  • CDN and reverse proxy behavior are enabled if they exist in production
  • Third-party services like search, payments, and analytics are either stubbed or safe to test
  • Robots, rate limits, or WAF rules will not block your test traffic

Because PrestaShop behavior can vary by version and theme, it’s good practice to inspect actual browser traffic in developer tools before finalizing your Locust scripts. That lets you confirm endpoint paths, CSRF tokens, and AJAX patterns used by your specific storefront.

Understanding PrestaShop Under Load

PrestaShop stores typically experience load in a few predictable areas:

Catalog Browsing

Anonymous users hit:

  • /
  • /category-name
  • /men/1-tshirts
  • /index.php?controller=category&id_category=3
  • product detail pages such as /summer-dress.html
  • search endpoints such as /search or /index.php?controller=search&s=shirt

These requests often stress:

  • PHP workers
  • template rendering
  • database reads
  • layered navigation and search indexes
  • image delivery if CDN caching is weak

Cart Operations

Cart actions are more dynamic and can be significantly heavier than browsing. Depending on the PrestaShop version and theme, cart updates may use:

  • /index.php?controller=cart&add=1&id_product=2&id_product_attribute=0&qty=1&token=...
  • /index.php?controller=cart&update=1
  • AJAX requests to theme-specific cart endpoints

These operations can stress:

  • session storage
  • cart calculation logic
  • tax and shipping rules
  • promotions and coupon engines
  • stock availability checks

Customer Authentication

Login and account pages usually involve:

  • /login
  • /my-account
  • /index.php?controller=authentication
  • form submissions with hidden tokens

Under heavy load, authentication can expose bottlenecks in:

  • session handling
  • customer table queries
  • slow password hashing on under-provisioned servers
  • module hooks firing on login

Checkout

Checkout is the most important performance path in any PrestaShop load testing strategy. It commonly includes:

  • cart summary
  • address selection
  • shipping method selection
  • payment option rendering
  • order review and confirmation

This flow often triggers:

  • multiple AJAX calls
  • tax computations
  • carrier calculations
  • payment module requests
  • order creation and email hooks

A store may survive homepage traffic but still fail under concurrent checkout traffic. That’s why realistic performance testing must include both browsing and conversion scenarios.

Writing Your First Load Test

Your first PrestaShop load test should simulate common anonymous shopper behavior: landing on the homepage, browsing categories, opening products, searching, and occasionally adding an item to the cart.

The example below uses realistic PrestaShop paths and extracts a CSRF-like cart token from the page before attempting an add-to-cart action.

python
from locust import HttpUser, task, between
import re
import random
 
class PrestaShopBrowsingUser(HttpUser):
    wait_time = between(2, 5)
 
    category_paths = [
        "/women",
        "/men",
        "/accessories",
        "/index.php?id_category=3&controller=category",
    ]
 
    product_paths = [
        "/men/1-1-hummingbird-printed-t-shirt.html",
        "/women/2-7-brown-bear-printed-sweater.html",
        "/accessories/6-mug-the-best-is-yet-to-come.html",
    ]
 
    search_terms = ["shirt", "dress", "mug", "notebook"]
 
    @task(3)
    def homepage(self):
        self.client.get("/", name="Homepage")
 
    @task(3)
    def browse_category(self):
        path = random.choice(self.category_paths)
        self.client.get(path, name="Category Page")
 
    @task(4)
    def view_product(self):
        path = random.choice(self.product_paths)
        self.client.get(path, name="Product Page")
 
    @task(2)
    def search(self):
        term = random.choice(self.search_terms)
        self.client.get(f"/search?controller=search&s={term}", name="Search")
 
    @task(1)
    def add_to_cart(self):
        product_path = random.choice(self.product_paths)
        response = self.client.get(product_path, name="Product Page for Cart", catch_response=True)
 
        token_match = re.search(r'token"\s*:\s*"([^"]+)"', response.text)
        if not token_match:
            token_match = re.search(r'name="token"\s+value="([^"]+)"', response.text)
 
        if not token_match:
            response.failure("Could not find cart token on product page")
            return
 
        token = token_match.group(1)
 
        payload = {
            "token": token,
            "id_product": "1",
            "id_customization": "0",
            "qty": "1",
            "add": "1",
            "action": "update",
        }
 
        headers = {
            "Content-Type": "application/x-www-form-urlencoded",
            "X-Requested-With": "XMLHttpRequest",
        }
 
        self.client.post(
            "/index.php?controller=cart",
            data=payload,
            headers=headers,
            name="Add to Cart"
        )

What this script tests

This script covers a realistic top-of-funnel shopper journey:

  • homepage access
  • category browsing
  • product detail rendering
  • search requests
  • cart updates

This is a good baseline load testing scenario because it mixes cached and uncached behavior. It can quickly reveal whether your PrestaShop store has issues with PHP capacity, database response times, or cart session handling.

Why this matters

A PrestaShop store that performs well for simple browsing is more likely to absorb traffic spikes gracefully. Use this test first before moving to authenticated and checkout-heavy performance testing.

Advanced Load Testing Scenarios

Once you have a basic browsing test, you should expand into more business-critical flows. The following scenarios are especially valuable for PrestaShop stress testing.

Authenticated Customer Login and Account Journey

Returning customers often log in before purchasing, checking order history, or updating addresses. This flow is important because it exercises session creation and customer-specific pages.

python
from locust import HttpUser, task, between
from bs4 import BeautifulSoup
 
class PrestaShopAuthenticatedUser(HttpUser):
    wait_time = between(2, 4)
 
    def on_start(self):
        self.login()
 
    def login(self):
        login_page = self.client.get("/login", name="Login Page")
        soup = BeautifulSoup(login_page.text, "html.parser")
 
        token_input = soup.find("input", {"name": "token"})
        token = token_input["value"] if token_input else ""
 
        payload = {
            "back": "my-account",
            "email": "loadtest.customer@example.com",
            "password": "TestPassword123!",
            "submitLogin": "1",
            "token": token,
        }
 
        with self.client.post(
            "/login",
            data=payload,
            name="Customer Login",
            catch_response=True
        ) as response:
            if "Sign out" in response.text or "My account" in response.text:
                response.success()
            else:
                response.failure("Login failed")
 
    @task(3)
    def my_account(self):
        self.client.get("/my-account", name="My Account")
 
    @task(2)
    def order_history(self):
        self.client.get("/history", name="Order History")
 
    @task(1)
    def addresses(self):
        self.client.get("/addresses", name="Customer Addresses")
 
    @task(2)
    def revisit_product(self):
        self.client.get("/women/2-7-brown-bear-printed-sweater.html", name="Authenticated Product View")

Why this scenario is useful

This test validates:

  • login response times
  • session persistence
  • customer account page performance
  • database behavior for customer-specific queries

If account pages degrade under load, you may have slow customer queries, excessive module hooks, or insufficient PHP worker capacity.

Full Cart and Checkout Flow

For PrestaShop, checkout performance is often the most important KPI. The script below simulates a customer who logs in, adds a product to the cart, visits checkout, and proceeds through address and shipping steps. Exact checkout endpoints can vary by version and theme, so adapt these paths to your store.

python
from locust import HttpUser, task, between, SequentialTaskSet
from bs4 import BeautifulSoup
import re
 
class CheckoutFlow(SequentialTaskSet):
    def on_start(self):
        self.login()
 
    def login(self):
        page = self.client.get("/login", name="Login Page")
        soup = BeautifulSoup(page.text, "html.parser")
        token_input = soup.find("input", {"name": "token"})
        token = token_input["value"] if token_input else ""
 
        payload = {
            "email": "checkout.tester@example.com",
            "password": "TestPassword123!",
            "submitLogin": "1",
            "token": token,
        }
 
        self.client.post("/login", data=payload, name="Customer Login")
 
    @task
    def add_product(self):
        product = self.client.get(
            "/men/1-1-hummingbird-printed-t-shirt.html",
            name="Product Page"
        )
 
        token_match = re.search(r'token"\s*:\s*"([^"]+)"', product.text)
        if not token_match:
            token_match = re.search(r'name="token"\s+value="([^"]+)"', product.text)
 
        token = token_match.group(1) if token_match else ""
 
        payload = {
            "token": token,
            "id_product": "1",
            "id_product_attribute": "1",
            "qty": "1",
            "add": "1",
            "action": "update",
        }
 
        headers = {
            "X-Requested-With": "XMLHttpRequest",
            "Content-Type": "application/x-www-form-urlencoded",
        }
 
        self.client.post(
            "/index.php?controller=cart",
            data=payload,
            headers=headers,
            name="Add to Cart"
        )
 
    @task
    def cart_summary(self):
        self.client.get("/cart?action=show", name="Cart Summary")
 
    @task
    def checkout_page(self):
        self.client.get("/checkout", name="Checkout Page")
 
    @task
    def submit_address(self):
        payload = {
            "id_address_delivery": "1",
            "id_address_invoice": "1",
            "confirm-addresses": "1",
        }
        self.client.post(
            "/checkout",
            data=payload,
            name="Checkout Address Step"
        )
 
    @task
    def submit_shipping(self):
        payload = {
            "id_delivery_option[1]": "2,",
            "delivery_message": "",
            "confirmDeliveryOption": "1",
        }
        self.client.post(
            "/checkout",
            data=payload,
            name="Checkout Shipping Step"
        )
 
    @task
    def payment_options(self):
        self.client.get("/checkout", name="Checkout Payment Step")
        self.interrupt()
 
class PrestaShopCheckoutUser(HttpUser):
    wait_time = between(1, 3)
    tasks = [CheckoutFlow]

What this checkout script reveals

This scenario is ideal for performance testing:

  • cart creation and updates
  • checkout rendering speed
  • shipping method processing
  • session continuity
  • customer/account/cart database interactions

In LoadForge, you can scale this across distributed generators to see how checkout performance changes at regional or global load levels.

AJAX Cart Updates and Coupon Application

Modern PrestaShop themes often rely on AJAX-heavy interactions. Coupon validation is another common bottleneck because it may invoke promotion rules, cart recalculation, and tax updates.

python
from locust import HttpUser, task, between
import re
 
class PrestaShopAjaxCartUser(HttpUser):
    wait_time = between(1, 3)
 
    def get_cart_token(self, html):
        token_match = re.search(r'token"\s*:\s*"([^"]+)"', html)
        if not token_match:
            token_match = re.search(r'name="token"\s+value="([^"]+)"', html)
        return token_match.group(1) if token_match else ""
 
    @task
    def ajax_cart_and_coupon(self):
        product_page = self.client.get(
            "/accessories/6-mug-the-best-is-yet-to-come.html",
            name="Product Page"
        )
        token = self.get_cart_token(product_page.text)
 
        add_payload = {
            "token": token,
            "id_product": "6",
            "qty": "2",
            "add": "1",
            "action": "update",
        }
 
        headers = {
            "X-Requested-With": "XMLHttpRequest",
            "Content-Type": "application/x-www-form-urlencoded",
        }
 
        self.client.post(
            "/index.php?controller=cart",
            data=add_payload,
            headers=headers,
            name="AJAX Add to Cart"
        )
 
        coupon_payload = {
            "discount_name": "SUMMER10",
            "addDiscount": "1",
            "token": token,
        }
 
        self.client.post(
            "/index.php?controller=cart",
            data=coupon_payload,
            headers=headers,
            name="Apply Coupon"
        )
 
        self.client.get("/cart?action=show", name="Cart After Coupon")

Why test coupons and AJAX interactions

Many stores underestimate how expensive promotions are. Coupon logic can become slow when:

  • many cart rules are active
  • customer segment rules are complex
  • shipping discounts must be recalculated
  • modules add extra validation steps

This kind of stress testing can expose conversion-killing slowdowns before a major sale.

Analyzing Your Results

After running your PrestaShop load testing scenarios in LoadForge, focus on these metrics:

Response Time by Endpoint

Look at median, p95, and p99 latency for:

  • homepage
  • category pages
  • product pages
  • search
  • add-to-cart
  • login
  • checkout steps

For e-commerce performance testing, averages alone are misleading. A checkout page with a decent average but a terrible p95 is still a business risk.

Error Rate

Watch for:

  • 5xx responses from PHP or upstream proxies
  • timeouts
  • session-related failures
  • failed login or cart submissions
  • payment or shipping step errors

If errors cluster around cart or checkout, inspect session storage, PHP-FPM worker exhaustion, and slow database queries first.

Throughput

Measure requests per second and completed user journeys, not just page hits. For PrestaShop, successful business transactions matter more than raw request volume.

Useful KPIs include:

  • carts created per minute
  • successful login rate
  • successful checkout step completion rate
  • search throughput under load

Resource Correlation

Correlate LoadForge test results with infrastructure metrics:

  • CPU and memory on web nodes
  • PHP-FPM active workers
  • MySQL CPU, locks, and slow queries
  • Redis or Memcached performance if used
  • CDN cache hit ratio
  • reverse proxy queueing

LoadForge’s real-time reporting helps you spot when latency rises relative to user count, and its distributed testing infrastructure helps distinguish application bottlenecks from regional network effects.

Performance Optimization Tips

Here are practical optimization steps based on common PrestaShop load testing findings:

Enable and Tune Caching

Use production-grade caching for:

  • Smarty/template rendering
  • full-page caching where compatible
  • Redis or Memcached for sessions/cache
  • reverse proxy caching for anonymous traffic

Category and product pages often improve dramatically with proper caching.

Optimize Database Queries

PrestaShop performance often depends heavily on MySQL efficiency. Review:

  • slow query logs
  • missing indexes
  • cart rule and search queries
  • stock and product combination lookups

Large catalogs and many active modules can create expensive joins.

Reduce Module Overhead

Audit installed modules, especially those affecting:

  • checkout hooks
  • search
  • cart recalculation
  • customer login
  • analytics and tracking

Each module may add database queries or remote API calls.

Scale PHP Workers Properly

If response times spike under moderate concurrency, you may be exhausting PHP-FPM workers. Increase capacity carefully and verify your database can handle the resulting increase in throughput.

Test Search and Faceted Navigation Separately

Faceted search and layered navigation can be much heavier than standard browsing. If your store relies heavily on filters, create dedicated load testing scenarios for those paths.

Validate Third-Party Dependencies

Payment gateways, fraud tools, recommendation engines, and shipping APIs can all affect checkout speed. In performance testing, isolate whether delays come from PrestaShop itself or external services.

Common Pitfalls to Avoid

Testing Only the Homepage

A homepage-only test is not enough for PrestaShop. Real shoppers browse products, search, log in, add to cart, and check out. Your scripts should reflect that.

Ignoring Dynamic Tokens

PrestaShop forms and cart actions often use tokens. Hardcoding them can cause false failures or unrealistic behavior. Extract tokens dynamically whenever possible.

Using Production Payment Endpoints

Never stress test real payment providers with live transactions unless explicitly approved. Use sandbox integrations or stop the flow before final order placement.

Forgetting Session Realism

Cart and checkout flows depend on cookies and sessions. Make sure each simulated Locust user behaves like an independent shopper.

Overlooking Theme-Specific AJAX Calls

Many PrestaShop stores use custom themes or modules that alter endpoint behavior. Inspect your actual storefront requests before assuming generic paths.

Not Separating Anonymous and Authenticated Traffic

Anonymous browsing is often cacheable; authenticated and checkout traffic is not. If you mix them without planning, results can be hard to interpret.

Running Tests Without Monitoring Backend Systems

Load testing without server-side metrics limits your ability to diagnose problems. Pair LoadForge results with APM, database monitoring, and infrastructure dashboards.

Conclusion

PrestaShop load testing is one of the best ways to protect revenue, improve customer experience, and prepare your store for high-traffic events. By testing realistic browsing, login, cart, coupon, and checkout flows, you can uncover the bottlenecks that matter most before they impact real shoppers.

LoadForge makes it straightforward to run scalable cloud-based performance testing and stress testing for PrestaShop using Locust scripts, with distributed testing, real-time reporting, CI/CD integration, and global test locations. If you want confidence that your PrestaShop store can handle peak demand, now is the perfect time to build your first test and try LoadForge.

Try LoadForge free for 7 days

Set up your first load test in under 2 minutes. No commitment.