Want more timely Centmin Mod News Updates?
Become a Member

Nginx Double aio bug on NGINX_IOURING_PATCH='y'

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Lav, Mar 14, 2020.

  1. Lav

    Lav Member

    49
    1
    8
    Feb 23, 2020
    Ratings:
    +1
    Local Time:
    10:27 PM
    1.17.8
    10.3
    Please fill in any relevant information that applies to you:
    • CentOS Version: 7.7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.17.9
    • PHP Version Installed: 7.3
    • MariaDB MySQL Version Installed: 10.3
    • Custom Config
      Code:
      NGINX_SSLCACHE_ALLOWOVERRIDE='y'
      SET_DEFAULT_MYSQLCHARSET='utf8mb4'
      AUTOHARDTUNE_NGINXBACKLOG='y'
      ZSTD_LOGROTATE_NGINX='y'
      ZSTD_LOGROTATE_PHPFPM='y'
      LETSENCRYPT_DETECT='y'
      DUALCERTS='y'
      NGINX_ZERODT='y'
      NGINX_LIBBROTLI='y'
      NGXDYNAMIC_BROTLI='y'
      PHP_PGO='y'
      PHP_BROTLI='y'
      PHP_LZFOUR='y'
      PHP_LZF='y'
      PHP_ZSTD='y'
      PHPFINFO='y'
      
      MARCH_TARGETNATIVE='n'
      AUDITD_ENABLE='y'
      
      ALERTEMAIL='myemail@email.com'
      
      NGINX_HPACK='y'
      AUTOTUNE_CLIENTMAXBODY='y'
      
      DEVTOOLSETNINE='y'
      DEVTOOLSET_PHP='y'
      CRYPTO_DEVTOOLSETGCC='y'
      GENERAL_DEVTOOLSETGCC='y'
      PHP_PATCH='y'
      STRIPPHP='y'
      PHP_TUNING='y'
      GCCINTEL_PHP='y'
      
      NGINX_PAGESPEED='y'
      NGXDYNAMIC_NGXPAGESPEED='y'
      
      MM_LICENSE_KEY='f**************5'
      NGINX_GEOIPTWOLITE='y'
      NGXDYNAMIC_GEOIPTWOLITE='y'
      
      NGINX_MODSECURITY='y'
      NGINX_MODSECURITY_MAXMIND='y'
      
      NGINX_IOURING_PATCH='y'
    I have tried this more than 10 times. Whenever I compile nginx via option 4 on centmin after inserting NGINX_IOURING_PATCH='y' then it gets stuck at the last process of some kill switch. Then after reconnecting SSH, I run
    Code:
    nginx -t
    it shows nginx: [emerg] "aio" directive is duplicate in /usr/local/nginx/conf/nginx.conf:102. Then I have to comment out the other aio on. It looks like this
    Code:
    sendfile off;
    aio on;
    #aio on;
    sendfile_max_chunk 512k;
    After this everything gets normal. Is this normal or is it conflicting with something from my customconfig file??
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,468
    10,319
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,005
    Local Time:
    2:57 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yes until i can spend time troubleshooting that duplicate aio on, disable and set NGINX_IOURING_PATCH='n' as I am unable to replicate this bug on my end right now and have no spare time to troubleshoot right now.

    I am going to disable NGINX_IOURING_PATCH='y' in next 123.09beta01 update temporarily because of this
     
  3. EckyBrazzz

    EckyBrazzz Active Member

    873
    183
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +334
    Local Time:
    1:57 PM
    Latest
    Latest
    NGINX_IOURING_PATCH='y' is only valid for kernel 5.x. If you enable it without kernel 5.x 123.09beta01 writes is aio on; in the nginx.conf file.

    Every time you recompile without kernel 5.x aio on; gets written back

    If you have a kernel 5.x, aio on; also gets written in the config file. On a recompile it does not appear twice.

    Missing part in 123.09beta01 is the verification of the presence of the correct kernel.
     
    Last edited: Mar 15, 2020
  4. Lav

    Lav Member

    49
    1
    8
    Feb 23, 2020
    Ratings:
    +1
    Local Time:
    10:27 PM
    1.17.8
    10.3
    My Linux Kernel version is 5.5.9-1.el7.elrepo.x86_64. I knew the minimum requirement so I have already upgraded to latest version but when I compile nginx by NGINX_IOURING_PATCH='y' then it puts two aio on in nginxconf by itself and I need to manually comment out one aio on and it starts working.
     
  5. eva2000

    eva2000 Administrator Staff Member

    45,468
    10,319
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,005
    Local Time:
    2:57 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    That is already in place for kernel detection before aio on is added
    Code (Text):
    if [[ "$NGINX_IOURING_PATCH_BETA" = [yY] && "$DETECT_NGXVER" -gt '1017000' && "$KERNEL_NUMERICVER" -ge '5001000000' ]]; then
    
    ** code to add aio on here **
    
    fi

    When you remove Kernel did you reboot server ? as the updated kernel will only take effect after reboot. So if you do not reboot, then Centmin Mod will only detect the older 5.1 kernel and not current non 5.1 kernel unless you reboot server after removing 5.1 kernel.
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,468
    10,319
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,005
    Local Time:
    2:57 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    I've disabled NGINX_IOURING_PATCH='y' and renamed it as NGINX_IOURING_PATCH_BETA='y' if you want to enable it and test my latest routine for Nginx IOURING to see if aio on duplication occurs in /usr/local/nginx/conf/nginx.conf.

    before running centmin.sh menu option 4, run cmupdate command to update to latest 123.09beta01 code
     
  7. EckyBrazzz

    EckyBrazzz Active Member

    873
    183
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +334
    Local Time:
    1:57 PM
    Latest
    Latest
    enabled every time
    test 1: recompile first time
    No trace of aio.io in nginx.conf.
    It was even an old config where aio.io was in the nginx.conf file as I switched & rebooted from 5.x back to 3.x. Conclusion: Even if enabled and aio.io present in the config files aio.io is removed from the nginx.conf file.
    test 2: recompile second time.
    No trace of aio.io in the nginx.conf file.

    test 3: recompile with kernel 5.x
    aio.io is present in the nginx.conf file.

    test 4: recompile second time with kernel 5.x
    aio.io is present in the nginx.conf file.

    test 5: Downgrade nginx from 1.17.9 to 1.17.8 and back to 1.17.9

    CONCLUSION:
    Not a single problem found in all above tests. @eva2000 well done, works fine. Thanks for adding the _BETA='y' option for testing.
     
  8. eva2000

    eva2000 Administrator Staff Member

    45,468
    10,319
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,005
    Local Time:
    2:57 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Thanks for the confirmation :)