These scenarios were used to perform load tests for Magento 1 and Magento 2 applications in different environments. Results are publicly available on MageCore blog:
- Magento CE 1.9 vs Magento CE 2.0 Performance Comparison
- How Does PHP 7 Affects Performance of Magento 1.9 CE vs. Magento 2.0 CE
Tests are grouped in application folders which include following assets:
media
- image files used for catalog productsmedia.sh
- script that initializes application media based on catalog and images from media folderdata.sql.gz
- database dumpgatling
- load test scenarios for Gatling load testing framework
- OS: Amazon Linux AMI 2015.03
- Web server: nginx/1.8.0 + php-fpm
- PHP: 5.5.30 or 7.0.3
- Varnish: 3.0.5
- Redis: 3.0.5
- Database: MySQL 5.6.27
- Create database and import dump from
data.sql.gz
of proper application - Install Magento application using database created on the previous step
- Copy
media
directory,media.set
andmedia.sh
script to some directory - Run
media.sh /path/to/magento_pub /path/to/media.set /path/to/source_media
to initialize product images - Install Gatling
- Copy files from
magento1/gatling
andmagento2/gatling
directories to gatlinguser-files
directory - Run gatling scenario using following options (please use m1 or m2 instead mX in the parameters bellow):
Option | Description | Default Value |
---|---|---|
dataDir | Data directory used in test scenarios | mXce |
users | The number of concurrent users | 20 |
ramp | Increase load to number of users in, sec | 30 |
during | Run test during period, minutes | 10 |
domain | Testing domain name | magento.test.com |
useSecure | Use HTTPS for secure pages | 0 |
project | Project Name for Report | Magento |
$ JAVA_OPTS="-Ddomain=www.mXce.com -Dusers=10"
$ gatling -s mX.defaultFrontTest
- Page load time optimization: build JS, enable JS minification, enable CSS minification
- Deploy static content:
php bin/magento setup:static-content:deploy
- Run compiler:
php bin/magento setup:di:compile
- Enable production mode:
Set $MAGE_MODE production
- Reindex catalog:
php bin/magento indexer:reindex
- Clean cache:
php bin/magento cache:clean