---
title: Scaling Shopware on Shopware PaaS | Shopware Community Hub
description: >-
  Learn how to effectively scale Shopware on Shopware PaaS to handle increased
  traffic and improve performance.
canonical_url: 'https://hub.shopware.com/learn/unit/paas-scaling'
---

# Scaling Shopware on Shopware PaaS

<LearningObjectives>

- Understand scaling strategies for Shopware on Shopware PaaS.
- Configure auto-scaling and resource management.
- Implement performance optimization techniques.
- Monitor and analyze scaling metrics.

</LearningObjectives>

# Scaling Shopware on Shopware PaaS: Growing with Confidence

Now that you understand how to operate your Shopware environment effectively, it's time to learn how to scale it to handle growth. Scaling your Shopware 6 shop is about preparing for growth—whether it's a seasonal spike, a successful marketing campaign, or long-term business expansion.

In this unit, you'll learn how to implement scaling strategies that will help your application grow with your business needs. Shopware PaaS gives you the tools to scale up (or down) without headaches, but you need to know how to use them effectively to ensure your shop stays fast and reliable, no matter the demand.

<Callout title="Why Scaling Matters" type="info">

A shop that can't handle increased traffic risks lost sales and unhappy customers. Proactive scaling ensures your shop stays fast and reliable, no matter the demand.

</Callout>

## Understanding Shopware PaaS Plans and Resources

Before you scale, it's important to know what resources are available. Shopware PaaS offers different plan tiers with specific resource limits:

**Available Container Sizes:**

- `XS`: 0.1 CPU, 128 MB RAM (Development only)
- `S`: 0.25 CPU, 256 MB RAM  
- `M`: 0.5 CPU, 512 MB RAM
- `L`: 1 CPU, 1024 MB RAM
- `XL`: 2 CPU, 2048 MB RAM
- `2XL`: 4 CPU, 4096 MB RAM
- `3XL`: 8 CPU, 8192 MB RAM

**Disk Size Options:**

- Minimum: 256 MB
- Maximum: 2048 GB (2TB)
- Common sizes: 512 MB, 1024 MB (1GB), 2048 MB (2GB), 4096 MB (4GB), 8192 MB (8GB)

**Scenario:**
Your shop is featured in a major campaign. You need to quickly increase resources to handle the surge—Shopware PaaS makes this possible with a few commands.

**How to check and upgrade your plan:**

```bash
shopware project:info
shopware plan:list
shopware project:subscription:update [plan_name]
```

## Scaling Strategies: Horizontal vs. Vertical

There are two main ways to scale your Shopware shop:

- **Horizontal scaling**: Add more app containers or workers to distribute the load.
- **Vertical scaling**: Increase resources (CPU, memory, disk) for existing containers.

### Horizontal Scaling: Distributing the Load

**Example:**
You add a new worker for background tasks, or set up a database cluster for high availability.

```yaml
# .platform.app.yaml
resources:
    base_memory: 1024
    memory_ratio: 256
workers:
    queue:
        size: S
        commands:
            start: |
                php bin/console messenger:consume async
    indexing:
        size: M
        commands:
            start: |
                php bin/console elasticsearch:index
```

```yaml
# .platform/services.yaml
db:
    type: mariadb:10.11
    configuration:
        properties:
            max_connections: 100
    cluster:
        p0:
            type: primary
            disk: 4096
        r1:
            type: replica
            disk: 2048
```

### Vertical Scaling: Bigger Containers

**Example:**
You increase the memory and CPU for your main app container to handle more traffic.

```yaml
# .platform.app.yaml
size: L
resources:
    base_memory: 2048
    memory_ratio: 512
disk: 4096
```

<Callout title="Tip" type="info">

Start with vertical scaling for quick wins, but use horizontal scaling for long-term growth and high availability.

</Callout>

## Load Balancing and Session Management

A scalable shop needs to balance traffic and manage sessions efficiently.

**Example:**
Configure HTTP cache and session storage for performance and reliability.

```yaml
# .platform.app.yaml
web:
    locations:
        "/":
            expires: 1h
            scripts: true
            allow: true
            rules:
                \.(css|js|svg|jpe?g|png|gif|ico)$:
                    expires: 2w
```

```yaml
# config/packages/framework.yaml
framework:
    session:
        handler_id: 'redis://cache:6379/1'
        save_path: 'tcp://cache.internal:6379'
```

## Monitoring Performance: Stay Ahead of Issues

Scaling is not "set and forget"—you need to monitor resource usage and performance.

**Scenario:**
After scaling up, you notice slow database queries. Use Shopware and Platform.sh tools to monitor and optimize.

```bash
shopware metrics
shopware activity:list
```

```sql
SHOW FULL PROCESSLIST;
SELECT * FROM information_schema.PROCESSLIST WHERE TIME > 10;
```

## Hands-on Exercise: Practice Scaling

1. Add a worker and configure clustering:

    ```bash
    shopware worker:add queue
    shopware service:update db --cluster
    ```

2. Monitor performance:

    ```bash
    shopware metrics
    shopware log app
    ```

## Common Pitfalls and How to Avoid Them

- **Over-scaling**: Only scale as much as you need—unused resources cost money.
- **Ignoring monitoring**: Always check metrics after scaling.
- **Not testing failover**: Simulate failures to ensure your scaling setup is resilient.

## Additional Resources

- [Platform.sh Scaling Documentation](https://fixed.docs.upsun.com/create-apps/app-reference.html)
- [Shopware Performance Guide](https://docs.shopware.com/en/shopware-6-en/tutorials-and-faq/performance-tips)
- [MariaDB Clustering Guide](https://mariadb.com/docs/galera-cluster)

## Key Takeaways

- **Scaling Strategies**: Understand the difference between horizontal and vertical scaling approaches.
- **Resource Management**: Know how to configure and manage resources effectively.
- **Performance Monitoring**: Implement monitoring to track scaling effectiveness.
- **Load Balancing**: Configure load balancing and session management for scalability.

## Next Steps

Now that you understand how to scale your Shopware application effectively, it's time to learn how to maintain it for long-term success.

In the next learning unit, we'll explore maintenance strategies, backup and recovery procedures, and monitoring techniques that will help you keep your application running smoothly.
