Generate data for performance testing

In addition to the command arguments described in this topic, see Common arguments.

Run all Magento CLI commands as the Magento file system owner.

Overview of performance testing data

To use the Magento Performance Toolkit or another tool for performance testing, you must generate a large amount of data (for example, stores, categories, products, and so on).

You can adjust the amount of data you create using profiles (small, medium, large, and extra large). The next section discusses profiles in more detail.

The following figure shows how a product displays on the storefront using the small profile:

Sample storefront with generated data

This gives you an idea about what the data looks like.

About profiles

The following table provides details about the data generator profiles (small, medium, large, and extra large).

Profiles are located in <your Magento install dir>/setup/performance-toolkit/profiles/<ce or ee>

For example, /var/www/html/magento2/setup/performance-toolkit/profiles/ce

Parameter Small profile Medium profile Large profile Extra large profile

websites

1

1

3

5

store_groups

1

2

3

5

store_views

1

2

3

5

simple_products

800

16,000

400,000

800,000

configurable_products

50

1,000

25,000

50,000

categories

30

300

1,000

3,000

categories_nesting_level

3

3

3

6

catalog_price_rules

10

20

50

100

catalog_target_rules

2

5

10

50

cart_price_rules

10

20

50

100

cart_price_rules_floor

2

2

2

5

customers

20

200

2,000

5,000

tax rates

40,000

40,000

40,000

40,000

orders

80

1,600

40,000

80,000

Run the data generator

Before running the data generator, disable all cron jobs running on the server. Disabling cron jobs prevents the data generator from performing actions that conflict with active cron jobs and avoids unnecessary errors.

Run the command as discussed in this section. After the command runs, you must reindex all indexers.

Command options:

bin/magento setup:perf:generate-fixtures {path to profile}

Where <path to profile> specifies the absolute file system path to, and name of, a profile.

For example,

bin/magento setup:perf:generate-fixtures /var/www/html/magento2/setup/performance-toolkit/profiles/ce/small.xml

Sample output for the small profile:

Generating profile with following params:
 |- Websites: 1
 |- Store Groups: 1
 |- Store Views: 1
 |- Categories: 30
 |- Simple products: 800
 |- Configurable products: 50
 |- Customers: 20
 |- Cart Price Rules: 10
 |- Catalog Price Rules: 10
 |- Orders: 80
Generating websites, stores and store views...  done in <time>
Generating categories...  done in <time>
Generating simple products...  done in <time>
Generating configurable EAV variations...  done in <time>
... more ...