Discover Centmin Mod today
Register Now

Prestashop poor performance :( centminmod / prestashop

Discussion in 'Ecommerce / Shopping cart usage' started by FAPM, Jul 17, 2015.

  1. FAPM

    FAPM Member

    58
    4
    8
    Jul 16, 2015
    Ratings:
    +6
    Local Time:
    10:07 PM
    1.9.2
    10.0.20
    Here testing prestashop on a VM (4 vcore) (xeon e3-1230) since my dedicated server, 2048 RAM, SATA raid1 on centminmod latest version (server hosted in France)

    Centos 6.6
    PrestaShop 1.6.1.0 (https SPDY ...) + pagespeed 1.9 + concat page speed
    nginx / 1.9.2
    PHP 5.5.27
    MariaDB MySQL-10.0.20
    PrestaShop:
    Smarty: cache yes
    cache: file system
    CCC: ON
    Cache: Yes memcached is 127.0.0.1:11211

    Gt Metrix (UK): Page Load Time 5.2S, speed score page: A (92%) YSlow score C (75%)
    PageSpeed insights: desktop: 81/100, mobile: 65/100
    WebPagetest: PageSpeed 1.12 Score: 92/100 load time : 9.47s first byte : 6.62 start render 8.1 speed index 8100 dom elements : 2604 document complete : 9.47

    webpagetest.png Performance is bad :(

    I do not understand: - /
    Filters
    ah Add Head
    cc Combine Css
    jc Combine Javascript
    gp Convert Gif to Png
    jp Convert Jpeg to Progressive
    jw Convert Jpeg To Webp
    mc Convert Meta Tags
    pj Convert Png to Jpeg
    ec Cache Extend Css
    ei Cache Extend Images
    es Cache Extend Scripts
    fc Fallback Rewrite Css
    if Flatten CSS Imports
    hw Flushes html
    ci Inline Css
    ii Inline Images
    il Inline @import to Link
    ji Inline Javascript
    js Jpeg Subsampling
    rj Recompress Jpeg
    rp Recompress Png
    rw Recompress Webp
    ri Resize Images
    cf Rewrite Css
    jm Rewrite External Javascript
    jj Rewrite Inline Javascript
    cu Rewrite Style Attributes With Url
    cp Strip Image Color Profiles
    md Strip Image Meta Data
     
  2. FAPM

    FAPM Member

    58
    4
    8
    Jul 16, 2015
    Ratings:
    +6
    Local Time:
    10:07 PM
    1.9.2
    10.0.20
    Code:
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    server {
      listen  80;
      server_name xx.xx.fr;
      rewrite ^ https://$host$request_uri? permanent;
           #return 302 https://$server_name$request_uri;
      }
    
    server {
    
      listen 443 ssl spdy;
     
         server_name xx.xx.fr;
         root /home/nginx/domains/xx.xx.fr/public;
       
       
         access_log /home/nginx/domains/xx.xx.fr/log/access.log combined buffer=32k;
         error_log /home/nginx/domains/xx.xx.fr/log/error.log;
         
         
         ssl_dhparam /usr/local/nginx/conf/ssl/xx.xx.fr/dhparam.pem;
         ssl_certificate /usr/local/nginx/conf/ssl/xx.xx.fr/xx_fr-unified.crt;
         ssl_certificate_key /usr/local/nginx/conf/ssl/xx.xx.fr/xx_fr.key;
    
       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_session_cache  shared:SSL:10m;
      ssl_session_timeout  10m;
      ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA;
      ssl_prefer_server_ciphers  on;
         add_header Alternate-Protocol  443:npn-spdy/3;
      add_header Strict-Transport-Security "max-age=31536000";
     
     
       # enable ocsp stapling
      resolver 8.8.8.8;
      ssl_stapling on;
      ssl_stapling_verify on;
      ssl_trusted_certificate /usr/local/nginx/conf/ssl/xx.xx.fr/ssl-trusted.crt;
     
       # Try static files first, then php 
       
    
       #Specify a charset
         index index.html index.htm index.php;
         charset utf-8;
         rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
      rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last;
      rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
      rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg last;
      rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last;
      rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
         rewrite ^/order$ /index.php?controller=order last;
     
           
         if (!-e $request_filename){
      rewrite ^(.*)$ /index.php last;
         } 
     
       
         location / {
         try_files $uri $uri/ /index.php?q=$uri&$args;
       
    
      }
    
         location /c {
      rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2$3.jpg last;
      rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2.jpg last;
      }
    
         location /p {
      rewrite ^/p/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2$3.jpg last;
      rewrite ^/p/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2.jpg last;
      }
    
         location /images_ie {
      rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
      }
    
         # Don't log robots.txt or favicon.ico files
         location ~* ^/(favicon.ico|robots.txt)$ {
       access_log off;
       log_not_found off;
      }
         # Custom 404 page
       error_page 404 /index.php?controller=404;
    
         # Deny access to .htaccess
         location ~ /\.ht {
       deny all;
      }
    
         # Block everything else in these directories
         #location ~ ^/img/cms/ {
       #deny all;
      #}
    
         # Block everything else in these directories
         location ~ ^/(adminxx/backups|adminxx/export|adminxx/import|adminxx/tabs|classes|config|docs|download|localization|log|override|tools|translations)/ {
       deny all;
      }
    
         # Block all files with these extensions
         location ~ \.(md|tpl)$ {
       deny all;
     
      }
         # Directories explicitly allowed in directories blocked below
         location ~ ^/docs/csv_import/ {
       allow all;
       }
     
       #CONCAT CSS
       location /css {
      concat on;
      concat_max_files 20;
       add_header Pragma public;
       add_header Cache-Control "public, must-revalidate, proxy-revalidate";
       access_log off;
       expires 30d;
      }
     
       #CONCAT JS
       location /js {
      concat on;
      concat_max_files 20;
       add_header Pragma private;
       add_header Cache-Control "private, must-revalidate, proxy-revalidate";
       access_log off;
       expires 30d;
      }
    
       location /home/nginx/domains/xx.xx.fr/public {
      location ~*\.(jpg|jpeg|gif|png|js|css)$ {
      add_header Cache-Control"public, max-age=600";
      }
    }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      #ngx_pagespeed & ngx_pagespeed handler
      include /usr/local/nginx/conf/pagespeed.conf;
      include /usr/local/nginx/conf/pagespeedhandler.conf;
      include /usr/local/nginx/conf/pagespeedstatslog.conf;
     
    Last edited: Jul 17, 2015
  3. eva2000

    eva2000 Administrator Staff Member

    30,872
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,397
    Local Time:
    7:07 AM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    You'd want to wrap posted code on forums in CODE tags for easier viewing. Most likely it's your site theme/style layout that is the problem with 8100ms speedindex score and 1MB page can only be so fast + slow database backend/poorly optimised mysql settings given first byte time is 6.6+ seconds (Centmin Mod provides basic settings out of box, you need to tune it yourself for your specific web app usage.

    Also test webpagetest from closer geo location to France. If you post site url folks can better help you too.
     
  4. FAPM

    FAPM Member

    58
    4
    8
    Jul 16, 2015
    Ratings:
    +6
    Local Time:
    10:07 PM
    1.9.2
    10.0.20
  5. eva2000

    eva2000 Administrator Staff Member

    30,872
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,397
    Local Time:
    7:07 AM
    Nginx 1.13.x
    MariaDB 5.5
  6. FAPM

    FAPM Member

    58
    4
    8
    Jul 16, 2015
    Ratings:
    +6
    Local Time:
    10:07 PM
    1.9.2
    10.0.20
    Yes indeed, I will reduce it
     
  7. FAPM

    FAPM Member

    58
    4
    8
    Jul 16, 2015
    Ratings:
    +6
    Local Time:
    10:07 PM
    1.9.2
    10.0.20
  8. eva2000

    eva2000 Administrator Staff Member

    30,872
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,397
    Local Time:
    7:07 AM
    Nginx 1.13.x
    MariaDB 5.5