Back to articles
AI & Cloud

Deploying Saleor Headless E-Commerce with GraphQL: Solution for Handling Millions of Concurrent Visits

A technical guide on deploying the open-source headless e-commerce platform Saleor with GraphQL on VPS, optimized for performance under millions of concurrent visits. Includes...

DPTCloud Engineering4 min read
Deploying Saleor Headless E-Commerce with GraphQL: Solution for Handling Millions of Concurrent Visits

Introduction to Saleor and Headless E-Commerce

Saleor is an open-source headless e-commerce platform built on GraphQL, enabling businesses to create flexible and fast user experiences. Its headless architecture separates backend operations—such as product management, order processing, and payments—from the frontend, allowing integration with any front-end framework like React, Vue, or Next.js.

This separation is ideal for high-traffic e-commerce applications, such as large-scale online retailers, as Saleor can scale efficiently on VPS or dedicated servers. Its modern architecture ensures low latency and high availability even under millions of concurrent visits.

Deployment Requirements and Preparation

To deploy Saleor effectively, you need:

  • A VPS with at least 4GB RAM and 2 CPU cores (8GB RAM and 4 CPU cores recommended)
  • Operating system: Ubuntu 20.04 or 22.04
  • Node.js 16+
  • Python 3.9+
  • PostgreSQL 13+
  • Docker and Docker Compose (optional but recommended)

Deploying Saleor on VPS

We will deploy Saleor using Docker for easier management and scalability.

Installation and Configuration

On your VPS, run the following commands:

sudo apt update
sudo apt install -y docker.io docker-compose
sudo usermod -aG docker $USER
# Restart or log out/in to apply Docker group changes

Create a project directory:

mkdir saleor-project && cd saleor-project

Create a docker-compose.yml file:

version: '3.8'
services:
  saleor:
    image: saleor/saleor:latest
    ports:
      - "8000:8000"
    environment:
      - DATABASE_URL=postgresql://saleor:password@db:5432/saleor
      - REDIS_URL=redis://redis:6379
      - SECRET_KEY=your-secret-key
    depends_on:
      - db
      - redis
  db:
    image: postgres:13
    environment:
      - POSTGRES_DB=saleor
      - POSTGRES_USER=saleor
      - POSTGRES_PASSWORD=password
    volumes:
      - db_data:/var/lib/postgresql/data
  redis:
    image: redis:6-alpine
    ports:
      - "6379:6379"
volumes:
  db_data:

Start the services:

docker-compose up -d

Performance Optimization

  • Apply the Liquorix Kernel on your VPS to reduce absolute latency, ideal for real-time web applications like e-commerce.
  • Use Btrfs or ZFS as Docker storage drivers to improve read/write speed and save disk space.
  • Enable Redis caching to reduce database load and improve response times.

Testing and Scaling

To test performance, use tools like ab (Apache Bench) or wrk:

ab -n 1000 -c 100 http://your-vps-ip:8000/graphql/

For scaling, consider:

  • Running multiple Saleor instances behind a Load Balancer (e.g., Nginx, HAProxy)
  • Using Redis Cluster and PostgreSQL Replication for high availability
  • Integrating with Qdrant or Typesense for faster product search

High-Traffic Resilience Solutions

To prevent system failure under millions of concurrent visits:

  • Set up auto-scaling on VPS or use cloud providers (AWS, GCP)
  • Implement rate limiting and DDoS protection
  • Monitor performance with Prometheus + Grafana
  • Perform regular data backups

References

Deploying Saleor on VPS enables businesses to build a powerful, flexible, and scalable e-commerce platform capable of handling millions of concurrent visits.

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478