24/7 Magento, server & cloud support · USA · UK · Europe · Middle East · Asia hello@scripulse.com
Reference solution · Magento & Ecommerce

High-traffic Magento 2 architecture with Varnish, Redis and OpenSearch

A layered Magento 2 platform built to stay fast under campaign traffic, with every cache and data tier sized and monitored.

A reference solution describes how we design and deliver this type of system. It is not a specific client case study.

Challenge

The business problem

Category, search and checkout pages slow down sharply during sales, and adding servers does not help because the bottleneck is in caching, the database or search.

Typical starting point

Magento 2.4 or Adobe Commerce on a few virtual machines, Varnish or Fastly misconfigured or bypassed, MySQL and OpenSearch sharing hosts with PHP.

Problems we usually find

  • Low full-page cache hit rate caused by private content and aggressive invalidation
  • PHP-FPM workers saturated while CPU is spent on uncached pages
  • OpenSearch undersized, with many unnecessary searchable attributes
  • Cron and queue consumers competing with customer traffic
Architecture

Solution architecture

Traffic passes through a CDN and WAF to Varnish, which serves cacheable pages without touching PHP. Stateless PHP-FPM nodes scale horizontally behind it, with admin, cron and queue consumers isolated on their own nodes. Redis runs as separate cache and session instances, and MySQL and OpenSearch sit on dedicated, monitored tiers.

High-traffic Magento 2 architecture with Varnish, Redis and OpenSearch architectureEdgeCDNWAFCacheVarnishfull-page cacheApplicationPHP-FPMweb nodesAdmin nodeCron + queueworkersDataMySQL /AuroraRediscacheRedissessionsOpenSearch

Engineering work

  • Profiled requests end to end (APM, slow logs, cache hit rate)
  • Fixed cache-busting blocks and invalidation rules
  • Separated Redis cache and sessions; tuned PHP-FPM and OPcache
  • Reduced searchable attributes and sized OpenSearch heap
  • Moved cron and consumers to dedicated workers
  • Load-tested checkout at 2x expected peak

Implementation approach

  1. Baseline: Core Web Vitals, TTFB, cache hit rate, error rate
  2. Fix highest-impact bottlenecks first, one change at a time
  3. Re-measure after every change
  4. Hand over dashboards and a capacity plan

How results are measured

We agree a baseline before work starts and track:

  • Full-page cache hit rate
  • Server response time (TTFB) for cached and uncached pages
  • Largest Contentful Paint and INP on mobile
  • Checkout error rate under load

Technology stack

Magento 2.4PHP-FPMVarnishRedisOpenSearchMySQL / AuroraNginxNew Relick6

Related services

Related solutions

Let’s talk

Facing this challenge?

Tell us about your environment and a senior engineer will suggest a first step.

Book a free audit →