Learn about Centmin Mod LEMP Stack today
Become a Member

Magento [Guide] How to install Magento 2.2.2 on Centmin Mod Nginx LEMP Stack

Discussion in 'Ecommerce / Shopping cart usage' started by eva2000, Mar 12, 2018.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    33,694
    7,459
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,470
    Local Time:
    11:04 AM
    Nginx 1.13.x
    MariaDB 5.5
    I wrote a quick Magento 2.2.2 installation guide specifically for Magento 2.2.2 installs on Centmin Mod 123.09beta01 or higher branch LEMP stack installations running Nginx 1.13 branch with PHP-FPM 7.1.x latest (Magento 2.2.2 doesn't support PHP 7.2 yet) and MariaDB 10.1.31 MySQL server. The guide is provided as is without any support.

    Magento 2.2.2 install is via Composer download and native Magento binary command tool and is 100% pure SSH command line install. FTP/SFTP is not used at all. The outlined Magento install steps could be used to write an automated script to install Magento 2.2.2 on Centmin Mod LEMP stacks purely from SSH command line. Maybe something planned on offer to Centmin Mod Premium Members ;)

    Disclaimer:

    I have never used Magento before so this is first attempt at installing Magento 2.2.2 after a quick read of the official Magento 2.2.2 documentation and Magento related info links outlined below in Magento Docs & Info Links section. I haven't gone beyond the initial Magento installation, so have no experience with managing and administrating Magento 2.2 application nor have I have any experience with Magento themes etc. It's purely a first time attempt outline for Magento 2.2.2. Hence, why I decided to setup this Magento install guide on a Github repository instead of the official Centmin Mod Community forums so I can accept contributions and corrections to the below guide via Git pull requests.

    All below installation steps assume you have thoroughly read those listed official Magento 2.2.2 documentation and links. So if you do not understand any of the SSH commands used, start reading the listed documentation and links.

    Github Repository:
    magento-222-admin-01.png magento-222-admin-01b.png magento-222-admin-02.png magento-222-admin-03.png magento-222-admin-04.png magento-222-admin-05.png magento-222-admin-05a.png magento-222-admin-06.png
     
    • Winner Winner x 1
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    33,694
    7,459
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,470
    Local Time:
    11:04 AM
    Nginx 1.13.x
    MariaDB 5.5
    Some of the command line Magento 2.2.2 stats and info

    system info
    Code (Text):
    n98-magerun2 sys:info --skip-root-check
    
                                 
      Magento System Information 
                                 
    
    +------------------+-----------------------------------------------+
    | name             | value                                         |
    +------------------+-----------------------------------------------+
    | Name             | Magento                                       |
    | Version          | 2.2.2                                         |
    | Edition          | Community                                     |
    | Root             | /home/nginx/domains/magento.domain.com/public |
    | Application Mode | production                                    |
    | Session          | redis                                         |
    | Crypt Key        | d45f000b87ce82******************              |
    | Install Date     | Sun, 11 Mar 2018 20:40:12 +0000               |
    | Cache Backend    | Cm_Cache_Backend_Redis                        |
    | Vendors          | Magento, Dotdigitalgroup, Shopial, Temando    |
    | Attribute Count  | 134                                           |
    | Customer Count   | 0                                             |
    | Category Count   | 2                                             |
    | Product Count    | 0                                             |
    +------------------+-----------------------------------------------+
    

    cache list
    Code (Text):
    n98-magerun2 cache:list --skip-root-check
    
                           
      Magento Cache Types 
                           
    
    +------------------------+--------------------------------+---------+
    | Name                   | Type                           | Enabled |
    +------------------------+--------------------------------+---------+
    | config                 | Configuration                  | 1       |
    | layout                 | Layouts                        | 1       |
    | block_html             | Blocks HTML output             | 1       |
    | collections            | Collections Data               | 1       |
    | reflection             | Reflection Data                | 1       |
    | db_ddl                 | Database DDL operations        | 1       |
    | eav                    | EAV types and attributes       | 1       |
    | customer_notification  | Customer Notification          | 1       |
    | config_integration     | Integrations Configuration     | 1       |
    | config_integration_api | Integrations API Configuration | 1       |
    | full_page              | Page Cache                     | 1       |
    | translate              | Translations                   | 1       |
    | config_webservice      | Web Services Configuration     | 1       |
    +------------------------+--------------------------------+---------+
    

    system check
    Code (Text):
    n98-magerun2 sys:check --skip-root-check
    
                                                                   
                                SETTINGS                           
                                                                   
    
    ✔ Secure BaseURL: https://magento.domain.com/ of Store: default - OK
    ✔ Unsecure BaseURL: https://magento.domain.com/ of Store: default - OK
    ✔ Empty cookie Domain (secure) of Store: default - OK
    ✔ Empty cookie Domain (unsecure) of Store: default - OK
    
                                                                   
                               FILESYSTEM                           
                                                                   
    
    ✔ Folder pub/media found.
    ✔ Folder var found.
    ✖ Folder var/cache not found! Usage: Used for caching
    ✔ Folder var/session found.
    ✔ File app/etc/env.php found.
    
                                                                   
                                  PHP                               
                                                                   
    
    ✔ Required PHP Module simplexml found.
    ✔ Required PHP Module mcrypt found.
    ✔ Required PHP Module hash found.
    ✔ Required PHP Module gd found.
    ✔ Required PHP Module dom found.
    ✔ Required PHP Module iconv found.
    ✔ Required PHP Module curl found.
    ✔ Required PHP Module soap found.
    ✔ Required PHP Module pdo found.
    ✔ Required PHP Module pdo_mysql found.
    ✔ Required PHP Module intl found.
    ✔ Required PHP Module openssl found.
    ✔ Bytecode Cache Zend OPcache found.
    
                                                                   
                                 MYSQL                             
                                                                   
    
    ✔ MySQL Version 10.1.31-MariaDB found.
    ✔ Required MySQL Storage Engine InnoDB found.
    

    database info
    Code (Text):
    n98-magerun2 db:info --skip-root-check 
    +------------------------+----------------------------------------------------------------------------------------------------+
    | Name                   | Value                                                                                              |
    +------------------------+----------------------------------------------------------------------------------------------------+
    | host                   | localhost                                                                                          |
    | dbname                 | magento2*****                                                                                      |
    | username               | magento2a6********                                                                                 |
    | password               | jIPa748zeZ***********                                                                              |
    | model                  | mysql4                                                                                             |
    | engine                 | innodb                                                                                             |
    | initStatements         | SET NAMES utf8;                                                                                    |
    | active                 | 1                                                                                                  |
    | prefix                 | mags_                                                                                              |
    | PDO-Connection-String  | mysql:host=localhost;port=3306;dbname=magento2****                                                 |
    | JDBC-Connection-String | jdbc:mysql://localhost:3306/magento2****?username=magento2a6*******&password=jjIPa748zeZ********** |
    | MySQL-Cli-String       | mysql -h'localhost' -u'magento2a6*******' --password='jjIPa748zeZ**********' 'magento2****'        |
    +------------------------+----------------------------------------------------------------------------------------------------+
    

    database server status
    Code (Text):
    n98-magerun2 db:status --skip-root-check
    +--------------------------------+--------------+-----------------------------------------------------------------------------+
    | Variable Name                  | Value        | Description                                                                 |
    +--------------------------------+--------------+-----------------------------------------------------------------------------+
    | Aborted_connects               |            0 | Total number of failed attempts to connect to MySQL.                        |
    | Created_tmp_disk_tables        |          406 | Number of temporary tables that have been created on disk instead of        |
    |                                |              | in-memory. Lower is better.                                                 |
    | Handler_read_first             |         6422 | Number of times a table handler made a request to read the first row of a   |
    |                                |              | table index.                                                                |
    | Handler_read_rnd_next          |      7280977 | Number of requests to read the next row in the data file. This value is     |
    |                                |              | high if you are doing a lot of table scans. Generally this suggests that    |
    |                                |              | your tables are not properly indexed or that your queries are not written   |
    |                                |              | to take advantage of the indexes you have.                                  |
    | Innodb_buffer_pool_pages_dirty |            0 | Indicates the number of InnoDB buffer pool data pages that have been        |
    |                                |              | changed in memory, but the changes are not yet written (flushed) to the     |
    |                                |              | InnoDB data files                                                           |
    | Innodb_buffer_pool_wait_free   |            0 | Number of times MySQL has to wait for memory pages to be flushed.           |
    | Key_reads                      |            9 | Number of filesystem accesses MySQL performed to fetch database indexes.    |
    | Max_used_connections           |           12 | Max number of connections MySQL has had open at the same time since the     |
    |                                |              | server was last restarted.                                                  |
    | Open_tables                    |          398 | Number of tables that are currently open.                                   |
    | Select_full_join               |           11 | Number of full joins MySQL has performed to satisfy client queries.         |
    | Slow_queries                   |            0 | Number of queries that have taken longer than usual to execute.             |
    | Threads_connected              |            1 | Total number of clients that have currently open connections to the server. |
    | Uptime                         | 19 hours ago | Time since the server was last restarted.                                   |
    | Full table scans               | 69.86%       | HINT: "Handler_read_rnd_next" is reset to zero when reached the value of    |
    |                                |              | 2^32 (4G).                                                                  |
    | InnoDB Buffer Pool hit         | 100.00%      | An InnoDB Buffer Pool hit ratio below 99.9% is a weak indicator that your   |
    |                                |              | InnoDB Buffer Pool could be increased.                                      |
    +--------------------------------+--------------+-----------------------------------------------------------------------------+
    

    MariaDB server variables of note
    Code (Text):
    n98-magerun2 db:variables --skip-root-check
    +---------------------------------+--------+
    | Variable Name                   | Value  |
    +---------------------------------+--------+
    | have_query_cache                |    YES |
    | innodb_additional_mem_pool_size |     8M |
    | innodb_buffer_pool_size         |   192M |
    | innodb_log_buffer_size          |     8M |
    | innodb_log_file_size            |   128M |
    | innodb_thread_concurrency       |      0 |
    | join_buffer_size                |   128K |
    | key_buffer_size                 |    32M |
    | max_allowed_packet              |    64M |
    | max_connections                 |    300 |
    | max_heap_table_size             |   128M |
    | open_files_limit                | 524288 |
    | query_cache_size                |    64M |
    | query_cache_type                |     ON |
    | read_buffer_size                |   128K |
    | read_rnd_buffer_size            |   256K |
    | sort_buffer_size                |   256K |
    | table_definition_cache          |   8192 |
    | table_open_cache                |   4096 |
    | thread_cache_size               |   128B |
    | tmp_table_size                  |   128M |
    +---------------------------------+--------+
    

    Magento 2 database engine breakdown stats
    Code (Text):
    echo "SELECT engine, count(*) tables, concat(round(sum(table_rows))) rows, concat(round(sum(data_length)/(1024*1024),2),'MB') data, concat(round(sum(index_length)/(1024*1024),2),'MB') idx, concat(round(sum(data_length+index_length)/(1024*1024),2),'MB') total_size, round(sum(index_length)/sum(data_length),2) idxfrac FROM information_schema.TABLES WHERE table_schema LIKE '$DBNAME' GROUP BY engine ORDER BY sum(data_length+index_length) DESC LIMIT 10;" | mysql -t
    +--------+--------+------+--------+---------+------------+---------+
    | engine | tables | rows | data   | idx     | total_size | idxfrac |
    +--------+--------+------+--------+---------+------------+---------+
    | InnoDB |    326 | 5535 | 5.59MB | 11.88MB | 17.47MB    |    2.12 |
    | MEMORY |     14 | 0    | 0.00MB | 0.00MB  | 0.00MB     |    NULL |
    +--------+--------+------+--------+---------+------------+---------+
    
     
    • Like Like x 1
    • Winner Winner x 1
    • Informative Informative x 1
  3. eva2000

    eva2000 Administrator Staff Member

    33,694
    7,459
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,470
    Local Time:
    11:04 AM
    Nginx 1.13.x
    MariaDB 5.5

    Redis cache vs File cached Magento 2.2.2 Benchmarks



    Thought I'd share my first benchmarks of Redis backend, page cache and session caching versus file based caching native to Magento 2.2.2. Benchmarks used my custom forked wrk-cmm load testing tool.

    Magento 2.2.2 install is done purely via SSH command line and the test KVM VPS server is of following specs:
    • 4 CPU Intel 2.40Ghz cpu
    • 4GB memory
    • 80GB disk
    • CentOS 7.4 64bit
    • Centmin Mod 123.09beta01 installed via betainstaller71.sh
    • Nginx 1.13.9
    • PHP-FPM 7.1.15 + Zend Opcache
    • MariaDB 10.1.31 MySQL Server
    • CSF Firewall
    The cpu is very old as it doesn't have SSE4.2 which was added back in Intel Nehalem architecture back in 2008 - making this cpu at least 10+ yrs old.
    Code (Text):
    lscpu
    Architecture:          x86_64
    CPU op-mode(s):        32-bit, 64-bit
    Byte Order:            Little Endian
    CPU(s):                4
    On-line CPU(s) list:   0-3
    Thread(s) per core:    1
    Core(s) per socket:    1
    Socket(s):             4
    NUMA node(s):          1
    Vendor ID:             GenuineIntel
    CPU family:            6
    Model:                 13
    Model name:            QEMU Virtual CPU version 1.5.3
    Stepping:              3
    CPU MHz:               2499.998
    BogoMIPS:              4999.99
    Hypervisor vendor:     KVM
    Virtualization type:   full
    L1d cache:             32K
    L1i cache:             32K
    L2 cache:              4096K
    NUMA node0 CPU(s):     0-3
    Flags:                 fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni cx16 hypervisor lahf_lm
    

    Benchmarks
    Redis
    Code (Text):
    n98-magerun2 sys:info --skip-root-check
    
                                 
      Magento System Information
                                 
    
    +------------------+-----------------------------------------------+
    | name             | value                                         |
    +------------------+-----------------------------------------------+
    | Name             | Magento                                       |
    | Version          | 2.2.2                                         |
    | Edition          | Community                                     |
    | Root             | /home/nginx/domains/magento.domain.com/public |
    | Application Mode | production                                    |
    | Session          | redis                                         |
    | Crypt Key        | d45f000b87ce82*******************             |
    | Install Date     | Sun, 11 Mar 2018 20:40:12 +0000               |
    | Cache Backend    | Cm_Cache_Backend_Redis                        |
    | Vendors          | Magento, MageHost, Dotdigitalgroup, Temando   |
    | Attribute Count  | 134                                           |
    | Customer Count   | 0                                             |
    | Category Count   | 2                                             |
    | Product Count    | 0                                             |
    +------------------+-----------------------------------------------+
    

    Redis TCP mode
    Code (Text):
    domain=https://magento.domain.com
    wrk-cmm -t2 -c2 -d10s --breakout -H 'Accept-Encoding: gzip' -s scripts/setup.lua --latency $domain
    thread 1 created
    thread 2 created
    Running 10s test @ https://magento.domain.com
      2 threads and 2 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
       Latency    31.15ms   10.16ms 158.71ms   97.59%
       Connect    14.00ms    5.32ms  17.76ms  100.00%
       TTFB       30.83ms   10.10ms 158.42ms   97.89%
       TTLB      316.32us  266.73us   4.59ms   97.25%
       Req/Sec    32.83      5.93    40.00     62.63%
      Latency Distribution
        50%   29.45ms
        75%   31.67ms
        90%   35.71ms
        99%   80.05ms
      655 requests in 10.06s, 4.64MB read
    Requests/sec:     65.14
    Transfer/sec:    472.44KB
    thread 1 made 330 requests and got 328 responses
    thread 2 made 328 requests and got 327 responses
    

    Redis Unix Socket mode
    Code (Text):
    domain=https://magento.domain.com
    wrk-cmm -t2 -c2 -d10s --breakout -H 'Accept-Encoding: gzip' -s scripts/setup.lua --latency $domain
    thread 1 created
    thread 2 created
    Running 10s test @ https://magento.domain.com
      2 threads and 2 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency    29.77ms    9.12ms 134.42ms   96.97%
        Connect     9.30ms    4.76ms  12.67ms  100.00%
        TTFB       29.46ms    9.08ms 134.08ms   96.97%
        TTLB      306.88us  212.53us   2.83ms   97.51%
        Req/Sec    34.26      6.07    40.00     97.47%
      Latency Distribution
         50%   28.09ms
         75%   30.42ms
         90%   33.51ms
         99%   75.62ms
      684 requests in 10.05s, 4.84MB read
    Requests/sec:     68.04
    Transfer/sec:    493.39KB
    thread 1 made 342 requests and got 340 responses
    thread 2 made 345 requests and got 344 responses

    File based caching
    Code (Text):
    n98-magerun2 sys:info --skip-root-check
    
                                 
      Magento System Information
                                 
    
    +------------------+-----------------------------------------------+
    | name             | value                                         |
    +------------------+-----------------------------------------------+
    | Name             | Magento                                       |
    | Version          | 2.2.2                                         |
    | Edition          | Community                                     |
    | Root             | /home/nginx/domains/magento.domain.com/public |
    | Application Mode | production                                    |
    | Session          | files                                         |
    | Crypt Key        | d45f000b87ce82*******************             |
    | Install Date     | Sun, 11 Mar 2018 20:40:12 +0000               |
    | Cache Backend    | Cm_Cache_Backend_File                         |
    | Vendors          | Magento, MageHost, Dotdigitalgroup, Temando   |
    | Attribute Count  | 134                                           |
    | Customer Count   | 0                                             |
    | Category Count   | 2                                             |
    | Product Count    | 0                                             |
    +------------------+-----------------------------------------------+

    Code (Text):
    wrk-cmm -t2 -c2 -d10s --breakout -H 'Accept-Encoding: gzip' -s scripts/setup.lua --latency $domain
    thread 1 created
    thread 2 created
    Running 10s test @ https://magento.domain.com
      2 threads and 2 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
       Latency    39.78ms   43.07ms 357.86ms   95.21%
       Connect    15.02ms    1.14ms  15.83ms  100.00%
       TTFB       39.35ms   42.99ms 357.27ms   95.22%
       TTLB      426.65us  153.00us   3.21ms   90.85%
       Req/Sec    31.85      7.32    40.00     64.74%
      Latency Distribution
        50%   29.49ms
        75%   31.51ms
        90%   39.24ms
        99%  292.20ms
      612 requests in 10.05s, 4.33MB read
    Requests/sec:     60.92
    Transfer/sec:    441.84KB
    thread 1 made 315 requests and got 313 responses
    thread 2 made 300 requests and got 299 responses
    

    Summary

    So my first 2 days noob experience with Magento 2.2.2 has been interesting. Benchmarks with Redis caching disabled and switching caching to file based so only slightly less performance that Redis caching in terms of average throughput at 60 requests/s versus 65-68 requests/s with Redis caching. But 99% percentile latency response times were much slower with file based caching at 292 ms vs 75-80ms with Redis caching. Thread TTFB latency max was also much higher with file based caching at 357+ ms versus Redis cached thread TTFB latency at 134-158 ms.

    It's very clear to me that Varnish Cache is really needed to scale Magento for Apache/Nginx setups or using Litespeed's LiteMage caching as Magento's native Redis caching still needs Nginx/PHP to process the requests so not totally bypassing PHP processes like I'd imagine it would. With my tests with Redis Nginx level caching of a Wordpress install I managed to scale to 302 million hits/day or 3,500+ average and 5,100+ peak requests/sec. I'd definitely choose WooCommerce over Magento if I had to start a shop just for the ability to better scale WooCommerce.

    During wrk-cmm load testing with Redis caching you can see the load still hitting Nginx and PHP-FPM.
    Code (Text):
    top -c
    top - 10:04:41 up  1:14,  2 users,  load average: 1.15, 0.94, 0.82
    Tasks: 119 total,  20 running,  99 sleeping,   0 stopped,   0 zombie
    %Cpu0  : 81.6 us, 16.4 sy,  0.0 ni,  0.3 id,  0.0 wa,  0.0 hi,  1.6 si,  0.0 st
    %Cpu1  : 79.5 us, 18.5 sy,  0.0 ni,  0.3 id,  0.0 wa,  0.0 hi,  1.7 si,  0.0 st
    %Cpu2  : 77.6 us, 20.1 sy,  0.0 ni,  0.3 id,  0.0 wa,  0.0 hi,  2.0 si,  0.0 st
    %Cpu3  : 76.9 us, 20.8 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  2.3 si,  0.0 st
    KiB Mem :  3881428 total,  2639780 free,   517272 used,   724376 buff/cache
    KiB Swap:  4194300 total,  4194300 free,        0 used.  3022348 avail Mem
    
      PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                    
      760 redis     20   0  159424   7524   1552 R  32.6  0.2   0:25.46 redis-server                                              
    11543 nginx     10 -10  157724  45128   2300 S  20.0  1.2   0:12.43 nginx                                                      
    13033 nginx     20   0  918384  27584  14580 R  20.0  0.7   0:01.47 php-fpm                                                    
    13027 nginx     20   0  918384  27576  14572 R  19.0  0.7   0:01.56 php-fpm                                                    
    13035 nginx     20   0  918384  27580  14576 R  18.7  0.7   0:01.59 php-fpm                                                    
    13032 nginx     20   0  918384  27580  14576 R  18.4  0.7   0:01.52 php-fpm                                                    
    13021 nginx     20   0  918480  27688  14588 R  18.1  0.7   0:02.20 php-fpm                                                    
    13031 nginx     20   0  918384  27580  14576 R  18.1  0.7   0:01.48 php-fpm                                                    
    13026 nginx     20   0  918384  27580  14576 R  17.7  0.7   0:01.85 php-fpm                                                    
    13029 nginx     20   0  918384  27576  14572 R  17.7  0.7   0:01.68 php-fpm                                                    
    13030 nginx     20   0  918384  27580  14576 R  17.7  0.7   0:01.58 php-fpm                                                    
    13036 nginx     20   0  918384  27580  14576 S  17.7  0.7   0:01.48 php-fpm                                                    
    13022 nginx     20   0  918384  27580  14576 R  17.4  0.7   0:02.20 php-fpm                                                    
    13023 nginx     20   0  918420  27620  14584 R  17.4  0.7   0:02.07 php-fpm                                                    
    13025 nginx     20   0  918384  27576  14576 R  17.4  0.7   0:02.26 php-fpm                                                    
    13034 nginx     20   0  918384  27580  14576 R  17.4  0.7   0:01.49 php-fpm                                                    
    13024 nginx     20   0  918468  27684  14588 R  17.1  0.7   0:02.28 php-fpm                                                    
    13028 nginx     20   0  918384  27576  14572 R  16.5  0.7   0:01.61 php-fpm                                                    
    11545 nginx     10 -10  153628  44512   2284 S  16.1  1.1   0:08.60 nginx                                                      
    11547 nginx     10 -10  157724  44672   2224 R  14.8  1.2   0:10.76 nginx                                                      
    11544 nginx     10 -10  153628  44512   2264 R  10.6  1.1   0:09.73 nginx                                                      
    13018 root      20   0  307660   8072   2360 S   6.8  0.2   0:00.57 wrk-cmm
    
     
    • Informative Informative x 2
  4. eva2000

    eva2000 Administrator Staff Member

    33,694
    7,459
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,470
    Local Time:
    11:04 AM
    Nginx 1.13.x
    MariaDB 5.5

    Magento 2 Varnish Cache Config & Benchmarks



    Next up is Magento 2 Varnish Cache Config & Benchmarks with Varnish Cache 5.2.x with HTTP/2 support proxying to a non-HTTPS magento.domain.com backend. For terminating HTTPS connections using Centmin Mod Nginx HTTP/2 HTTPS as reverse proxy in front of Varnish Cache as Varnish Cache can't fully handle HTTPS itself. The work flow looks like this:
    Code (Text):
    Visitor > Nginx HTTP/2 HTTPS Proxy > Varnish Cache HTTP/2 Enabled > Nginx non-HTTPS backend
    


    magento-222-admin-varnish-cache-01.png

    Quick benchmarks with Redis caching for sessions and backend and Varnish Cache for full page caching and a huge boost in performance compared to using Redis caching for full page caching jumping from 65-68 requests/sec and TTFB thread latency max at between 134-158ms.

    first run without cache warm up with 569 requests/s and TTFB thread latency max at 581ms
    Code (Text):
    domain=https://magento.domain.com
    wrk-cmm -t2 -c2 -d10s --breakout -H 'Accept-Encoding: gzip' -s scripts/setup.lua --latency $domain
    thread 1 created
    thread 2 created
    Running 10s test @ https://magento.domain.com
      2 threads and 2 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency    11.03ms   53.21ms 581.69ms   97.69%
        Connect    12.42ms    9.14ms  28.15ms   55.00%
        TTFB       10.53ms   54.13ms 581.03ms   97.63%
        TTLB      709.65us    0.90ms  26.59ms   96.59%
        Req/Sec   294.81    119.88   620.00     64.95%
      Latency Distribution
         50%    2.97ms
         75%    3.94ms
         90%    7.20ms
         99%  356.80ms
      5736 requests in 10.08s, 39.96MB read
    Requests/sec:    569.02
    Transfer/sec:      3.96MB
    thread 1 made 2680 requests and got 2678 responses
    thread 2 made 3059 requests and got 3058 responses
    

    second run with warmed up cache with 1,011 requests/second and TTFB thread latency max at 12.54ms
    Code (Text):
    wrk-cmm -t2 -c2 -d10s --breakout -H 'Accept-Encoding: gzip' -s scripts/setup.lua --latency $domain
    thread 1 created
    thread 2 created
    Running 10s test @ https://magento.domain.com
      2 threads and 2 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
       Latency     1.99ms    0.90ms  13.00ms   91.47%
       Connect     7.28ms    5.85ms  17.71ms   52.00%
       TTFB        1.46ms  679.66us  12.54ms   81.05%
       TTLB      505.80us  583.70us   6.74ms   91.19%
       Req/Sec   508.07    126.29   720.00     66.50%
      Latency Distribution
        50%    1.49ms
        75%    2.49ms
        90%    2.76ms
        99%    5.49ms
      10124 requests in 10.01s, 70.53MB read
    Requests/sec:   1011.06
    Transfer/sec:      7.04MB
    thread 1 made 5153 requests and got 5151 responses
    
     
    • Like Like x 1
..
Thread Status:
Not open for further replies.