SyliusCon 2025 in Lyon
Join Us!
LogoLogo
πŸ›£οΈ RoadmapπŸ’» Sylius DemoπŸ’¬ Community Slack
  • Sylius Documentation
  • Sylius Plugins
  • Sylius Stack
  • πŸ“–Sylius Documentation
  • Organization
    • Sylius Team
  • Release Cycle
    • Backwards Compatibility Promise
  • Getting Started with Sylius
    • Installation
    • Basic Configuration
    • Shipping & Payment
    • First Product
    • Customizing the Shop
    • Customizing Business Logic
    • Using API
    • Installing Plugins
    • Deployment
    • Summary
  • The Book
    • Introduction to Sylius
    • Installation
      • System Requirements
      • Sylius CE Installation
        • Sylius CE Installation with Docker
      • βž•Sylius Plus Installation
      • Upgrading Sylius CE
      • Upgrading Sylius Plus
    • Architecture
      • Architecture Overview
      • Architectural Drivers
      • Resource Layer
      • State Machine
      • Translations
      • E-Mails
      • Contact
      • Fixtures
      • Events
    • Configuration
      • Channels
      • Locales
      • Currencies
    • Customers
      • Customer & ShopUser
      • βž•Customer Pools
      • AdminUser
      • Addresses
        • Countries
        • Zones
        • Addresses
        • Address Book
    • Products
      • Products
      • Product Reviews
      • Product Associations
      • Attributes
      • Pricing
        • B2B Pricing Engine
      • Catalog Promotions
      • Taxons
      • Inventory
      • βž•Multi-Source Inventory
      • Search
    • Carts & Orders
      • Orders
      • Cart flow
      • Taxation
      • Adjustments
      • Cart Promotions
      • Coupons
      • Payments
      • 🧩Invoices
      • Shipments
    • 🎨Frontend & Themes
    • Support
    • Contributing
      • Contributing Code
        • Submitting a Patch
        • ⚠️Security Issues
        • Coding Standards
        • Conventions
        • Sylius License and Trademark
      • Contributing Translations
      • Key Contributors
  • The Customization Guide
    • Customizing Models
      • How to add a custom model?
      • How to add a custom translatable model?
    • Customizing Forms
      • How to add a live form for a custom model?
    • Customizing Templates
    • Customizing Styles
    • Customizing Dynamic Elements
    • Customizing Validation
    • Customizing Menus
    • Customizing Translations
    • Customizing Flashes
    • Customizing State Machines
    • Customizing Grids
    • Customizing Fixtures
    • Customizing API
    • Customizing Serialization of API
    • Customizing Payments
      • How to integrate a Payment Gateway as a Plugin?
  • πŸ§‘β€πŸ³THE COOKBOOK
    • How to resize images?
  • How to add one image to an entity?
  • How to add multiple images to an entity?
  • How to add a custom cart promotion action?
  • How to add a custom cart promotion rule?
  • How to add a custom catalog promotion action?
  • How to add a custom catalog promotion scope?
  • How to customize catalog promotion labels?
  • How to improve the performance of the catalog promotions?
  • How to add a custom shipping method rule?
  • Sylius 1.X Documentation
    • πŸ““Sylius 1.x Documentation
Powered by GitBook
LogoLogo

Developer

  • Community
  • Online Course

About

  • Team

Β© 2025 Sylius. All Rights Reserved

On this page
  • πŸ”§ Configuring the Batch Size
  • Default Value
  • How to Change It
  • πŸ’‘ Choose the Right Batch Size for Your Server
  • Best Practices
  • βœ… Summary

Was this helpful?

Edit on GitHub

How to improve the performance of the catalog promotions?

Catalog promotions in Sylius can affect a large number of product variants. By default, Sylius processes them in batches of 100 variants. In performance-critical environments, you might want to adjust this size for faster or more memory-efficient execution.

This guide explains how to tune the batch size to improve performance and stability.


πŸ”§ Configuring the Batch Size

By default, Sylius processes 100 product variants per batch when applying catalog promotions.

You can adjust this in your configuration to better fit your environment:

Default Value

sylius_core:
    catalog_promotions:
        batch_size: 100

How to Change It

To override the default value, add the following configuration to your configuration:

# config/packages/_sylius.yaml

sylius_core:
    catalog_promotions:
        batch_size: 250  # Adjust this value as needed

πŸ’‘ Choose the Right Batch Size for Your Server

The appropriate batch size depends on your server’s memory, CPU, and I/O capabilities.

Batch Size Range
When to Use

50–100

Safe default for most environments, avoids memory issues, might be slower

250–1000

Suitable for optimized production servers with high throughput

Best Practices

  • Smaller values reduce risk of timeouts or memory leaks.

  • Larger values improve speed but must be tested carefully.


βœ… Summary

  • Sylius applies catalog promotions in batches for performance and reliability.

  • Adjust the batch_size setting to fit your server's capacity.

  • Always test changes in staging and monitor key performance metrics.


πŸ” Performance Testing Before Deployment

Always test any batch size changes in a staging environment before applying them in production. Monitor key metrics such as memory usage, CPU load, and execution time during catalog promotion processing to ensure the system remains stable and responsive.

Catalog Promotion Processing

Catalog promotions in Sylius are executed using the Symfony Messenger component. This allows for both synchronous (inline) and asynchronous (queued) message handling, depending on your project configuration.

Learn more about this component here.

PreviousHow to customize catalog promotion labels?NextHow to add a custom shipping method rule?

Last updated 2 days ago

Was this helpful?