Jump to content

Very Slow Combination Generation in Product – Takes Over 2 Minutes (PrestaShop 1.7.6.8)


jaxuk

Recommended Posts

Hello everyone,

I'm having a serious performance issue when generating combinations in PrestaShop 1.7.6.8.

My shop setup includes:

  • 135 sizes and 555 colors as attributes
  • Around 1,000 products in total

Whenever I try to generate a combination for a product (for example, size S and a color), the request takes more than 2 minutes to complete. This happens both on my hosting server and in a local environment.

Things I've already tried:

  • Cleared cache (both Smarty and browser)
  • Verified all server configurations (PHP settings, limits, timeouts)
  • Tested on multiple environments – same result
  • I’m now starting to suspect that the issue might be related to database performance or something within the way combinations are processed.

Has anyone experienced something similar, or can give me an idea what else to check or optimize?

Any help would be greatly appreciated.
Thank you!

Screenshot 2025-06-03 at 17.21.16.png

Link to comment
Share on other sites

Do I understand correctly that you have 80,000 combinations for each product? Have you considered generating only the combinations that actually make sense? With such a large number of combinations, the best approach would be to generate them locally using a custom module or a PHP script, and then import those combinations directly into the database.

Link to comment
Share on other sites

as you can imagine, more details is needed, maybe this helps provide more info:

PrestaShop’s back-office is a Symfony app, so you get the Symfony Debug Toolbar and Profiler:

Ensure Debug Mode
With _PS_MODE_DEV_ = true, log into the back-office.

Locate the Debug Toolbar
In the lower-left corner of any BO page you’ll see a slim Symfony toolbar (icons for performance, DB, logs, etc.).

Open the Profiler

Click the “Symfony” icon (🕷).

In the popup, click “Profiler” to open a full page at /app_dev.php/_profiler/….

Explore the Panels

  • Timeline—a waterfall view of each request phase.
  • Database—all SQL queries, with timings and call stacks.
  • Events—hooks and listeners that fired.
  • Logs—PHP errors, error_log() entries, and debug messages.
  • Performance—CPU time, memory peaks, service calls.
Link to comment
Share on other sites

This may help:

Review your MySQL settings in phpMyAdmin—look for any values in red and address them.

  • Adjust key variables like innodb_buffer_pool_size, query_cache_size, and max_connections to recommended levels.
  • Enable the slow query log temporarily to find slow queries, then disable it once finished.
  • Monitor and adjust settings regularly as your traffic and database grow.
  • Consider upgrading to faster storage (NVMe SSD), stronger hosting, or newer software.
  • For intensive tasks (like combinations generation), have a developer review and update these processes to run from the command line (CLI) instead of the web interface. This avoids PHP limits and dramatically improves performance.

How to Check MySQL Database Settings Using phpMyAdmin

  1. Log in to phpMyAdmin from your hosting control panel.
  2. Select your database in the sidebar.
  3. Click the “Variables” tab at the top to see MySQL settings.
  4. Look for values in red—these highlight settings below recommended levels.
  • innodb_buffer_pool_size: Should be 60–80% of server RAM for dedicated databases.
  • query_cache_size: 32–128MB for MySQL 5.7 or lower; zero for MySQL 8.0+.
  • max_connections: 100–300, depending on traffic and available RAM.
  • slow_query_log: Enable temporarily to find slow queries, then turn off.

Monitor these values regularly and adjust as needed.

Depending on your hosting (shared, VPS, or dedicated), you may need to request changes from your provider.

 

PrestaShop 1.7.6.x has known issues with slow combination generation—especially with products having many attributes/values. This is mostly due to inefficient PHP logic, lack of batching, and sometimes database design.

  • Later PrestaShop versions (1.7.7.x, 1.7.8.x, and 8.x) introduced several performance fixes for the combination generator:
  • More efficient algorithms to generate combinations.
  • Improved JavaScript handling for large attribute sets in the admin.
  • Reduction in redundant database calls during generation.
  • Better handling of saving/updating combinations in bulk.
  • PrestaShop 8.x continues these improvements, and the new combination generator is significantly faster and more reliable for catalogs with thousands of combinations.

Additional Tips

  • Use NVMe SSD hosting for faster database performance.
  • Upgrade your application to the latest version for improved efficiency.
  • Have a developer review performance issues—especially combination generation or imports—and move heavy tasks to CLI scripts.
  • Running these from the command line avoids PHP web server limits and ensures faster, more reliable processing.
Edited by El Patron (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...