Get the most out of your Centmin Mod LEMP stack
Become a Member

Beta Branch add NGINX_DEVTOOLSETGCC for devtoolset-3 GCC 4.9 CentOS 7 nginx in 12…

Discussion in 'Centmin Mod Github Commits' started by eva2000, Oct 5, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    12:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    add NGINX_DEVTOOLSETGCC for devtoolset-3 GCC 4.9 CentOS 7 nginx in 123.09beta01

    CentOS 7 uses GCC 4.8.5 version which satisfies ngx_pagespeed 1.10+ and ngx_brotli mininum GCC requires of 4.8+. CentOS 6 uses GCC 4.4.7 and requires devtoolset-3 package's GCC 4.9. This update adds a new option to control devtoolset-3 GCC 4.9 usage on CentOS 7 via NGINX_DEVTOOLSETGCC='n' which is disabled by default. Nginx is compiled with GCC 4.9 instead of system GCC 4.8.5 on CentOS 7 when enabled via setting NGINX_DEVTOOLSETGCC='y' in persistent config file /etc/centminmod/custom_config.inc and then recompile nginx via centmin.sh menu option 4. This opens up the doors for future devtoolset-4 support for GCC 5.3 and so forth on CentOS systems.

    Centmin Mod Nginx can be compiled with either GCC or Clang compilers and defaults to using Clang via CLANG='y' option in centmin.sh. You can override this and switch from default Clang to GCC compilers for Nginx via CLANG='n' variable set in persistent config file /etc/centminmod/custom_config.inc and then recompile nginx via centmin.sh menu option 4.

    So basically for CentOS 7 to use GCC 4.9 via devtoolset-3, set in persistent config file /etc/centminmod/custom_config.inc the following variables:
    Code (Text):
    NGINX_DEVTOOLSETGCC='y'
    CLANG='n'
    

    then recompile nginx via centmin.sh menu option 4

    Running command below will tell you what Nginx is compiled and built with
    Code (Text):
    nginx -V
    



    Continue reading...

    123.09beta01 branch
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    12:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    centmin.sh menu option 4 recompile on CentOS 7 to use GCC 4.9 via devtoolset-3, set in persistent config file /etc/centminmod/custom_config.inc the following variables:
    Code (Text):
    NGINX_DEVTOOLSETGCC='y'
    CLANG='n'
    

    CentOS 7 -march=native and gcc 4.9.2
     
  3. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    10:57 AM
    Mainline
    10.2
    What is the advantage of this? :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    12:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    mainly right now mainly that nginx compilation/installs/upgrade are also more optimised specifically for intel processors - particularly better optimised for newer Haswell and higher processors.
     
  5. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    4:57 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    I have clang 3.4.2

    Code:
    # nginx -V
    nginx version: nginx/1.11.5
    built by clang 3.4.2 (tags/RELEASE_34/dot2-final)
    built with LibreSSL 2.4.3
    TLS SNI support enabled
    How to find is that what I am using on server?
    Will it be better to switch to gcc than?
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    12:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    find cpu used on server
    Code (Text):
    cat /proc/cpuinfo

    if you set CLANG='n' to use GCC, centmin mod will auto detect intel processor or not and run accordingly
     
  7. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    4:57 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    Code:
    cat /proc/cpuinfo
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 63
    model name      : Intel(R) Xeon(R) CPU E5-2650L v3 @ 1.80GHz
     
  8. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    4:57 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    model name : Intel(R) Xeon(R) CPU E5-2650L v3 @ 1.80GHz
     
  9. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    12:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah Intel though centmin mod automatically detects and uses appropriate GCC options when CLANG='n' is set in persistent config file
     
  10. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    4:57 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    So just add both:
    Code:
    NGINX_DEVTOOLSETGCC='y'
    CLANG='n'
    And recompile nginx again.

    Should be better than to use gcc instead clang for my server?
     
  11. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    12:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yup
    • GCC results in software compiled/installed that performs faster but takes longer to compile - ALOT longer !
    • Clang results in faster compiling but not necessarily faster software
     
  12. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    4:57 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    OK
    Going to add this two rows and recompile nginx
     
  13. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    4:57 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    Total Nginx Upgrade Time: 626.860360963 seconds

    I think that is it.
    Seems all OK
     
  14. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    12:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    looks good :)