How to configure Magento 2
for max performance
(based on 1 benchmark :)
Daniel Genis
Difficulties when benchmarking
Not representative for every shop
Easy to make mistakes
Many choices:
1. various benchmarking methods
2. various ways of measuring
3. cold or hot caches
Complexity
The shop
Sample data magento 2.0
not that many products
no extensions
about 3000 unique frontend URLs
Benchmarking frontend only
The benchmark tools
JMeter test plan, 20 threads doing:
Request a frontend page + all static content
upon completion wait 2 seconds
Request a different frontend page + static content
Each thread has a pre-generated list of urls
Each thread makes 50 requests per default
A warming run was done before actual benchmark
The test server
Hypernode - Magento Grow
2 cpu cores
2 gb ram
SSD storage
Small test server
Easier to push to its limits
And to show off our Hypernode setup :)
no redis, no varnish: 378 ms median
ms
20 threads 50 req / thread
redis caching, no varnish: 372 ms median
20 threads 50 req / thread
Redis caching 10 threads: 263 ms!
10 threads 100 req / thread
varnish caching: 116 ms !! :)
20 threads 50 req / thread
Statistical summary
clean install redis cache redis 10thr varnish cache
Average 412 ms 403 ms 278 ms 125 ms
Median 378 ms 372 ms 263 ms 116 ms
95th
percentile
727 ms 710 ms 423 ms 187 ms
CPU util 100% 100% 50% 20%
Relative 324% 321% 226% 100%
Nice!
Conclusions
1. Varnish is obviously the fastest setup
2. Redis gives no measurable improvement
(when local file cache fits in RAM)
3. Magento 2 is awesome
4. Cold cache: Magento 2 is still Magento :)
Observations
Caching is easy to setup (compared to Mag1)
Varnish cache built-in
Redis cache built-in
No plugins needed
These benchmarks were very bandwidth sensitive
Static content!
html: ~10kb
total incl static: ~1mb
Bonus: disk cache vs Redis cache
Cache entries are stored in 'core_cache_tag' table
On multistore environment this table can grow very large
SELECTS are fine
but UPDATE/INSERTS become more work (scalability issue)
Redis is more efficient (than memcached or default cache)
For various query/update scenarios
Has high availability (i.e. master/slave replication)
See it in action!
http://mag2demo.hypernode.com/
For backend login details are available at the bottom!
Try your own benchmark!
1. go to byte.nl
2. get your free Hypernode Trial
3. install Magento 2 or install your own site
4. https://github.com/ByteInternet/m2benchmark
5. profit!
Bedankt!
Blijf op de hoogte van de laatste ontwikkelingen op
hosting-gebied. Volg ons op twitter: @Byte_NL

Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks

  • 1.
    How to configureMagento 2 for max performance (based on 1 benchmark :) Daniel Genis
  • 2.
    Difficulties when benchmarking Notrepresentative for every shop Easy to make mistakes Many choices: 1. various benchmarking methods 2. various ways of measuring 3. cold or hot caches Complexity
  • 3.
    The shop Sample datamagento 2.0 not that many products no extensions about 3000 unique frontend URLs Benchmarking frontend only
  • 4.
    The benchmark tools JMetertest plan, 20 threads doing: Request a frontend page + all static content upon completion wait 2 seconds Request a different frontend page + static content Each thread has a pre-generated list of urls Each thread makes 50 requests per default A warming run was done before actual benchmark
  • 5.
    The test server Hypernode- Magento Grow 2 cpu cores 2 gb ram SSD storage Small test server Easier to push to its limits And to show off our Hypernode setup :)
  • 6.
    no redis, novarnish: 378 ms median ms 20 threads 50 req / thread
  • 7.
    redis caching, novarnish: 372 ms median 20 threads 50 req / thread
  • 8.
    Redis caching 10threads: 263 ms! 10 threads 100 req / thread
  • 9.
    varnish caching: 116ms !! :) 20 threads 50 req / thread
  • 10.
    Statistical summary clean installredis cache redis 10thr varnish cache Average 412 ms 403 ms 278 ms 125 ms Median 378 ms 372 ms 263 ms 116 ms 95th percentile 727 ms 710 ms 423 ms 187 ms CPU util 100% 100% 50% 20% Relative 324% 321% 226% 100% Nice!
  • 11.
    Conclusions 1. Varnish isobviously the fastest setup 2. Redis gives no measurable improvement (when local file cache fits in RAM) 3. Magento 2 is awesome 4. Cold cache: Magento 2 is still Magento :)
  • 12.
    Observations Caching is easyto setup (compared to Mag1) Varnish cache built-in Redis cache built-in No plugins needed These benchmarks were very bandwidth sensitive Static content! html: ~10kb total incl static: ~1mb
  • 13.
    Bonus: disk cachevs Redis cache Cache entries are stored in 'core_cache_tag' table On multistore environment this table can grow very large SELECTS are fine but UPDATE/INSERTS become more work (scalability issue) Redis is more efficient (than memcached or default cache) For various query/update scenarios Has high availability (i.e. master/slave replication)
  • 14.
    See it inaction! http://mag2demo.hypernode.com/ For backend login details are available at the bottom!
  • 15.
    Try your ownbenchmark! 1. go to byte.nl 2. get your free Hypernode Trial 3. install Magento 2 or install your own site 4. https://github.com/ByteInternet/m2benchmark 5. profit!
  • 16.
    Bedankt! Blijf op dehoogte van de laatste ontwikkelingen op hosting-gebied. Volg ons op twitter: @Byte_NL