Want more timely Centmin Mod News Updates?
Become a Member

Beta Branch update inc/cpcheck.inc nginxlargefile_fix function

Discussion in 'Centmin Mod Github Commits' started by eva2000, Oct 9, 2017.

  1. eva2000

    eva2000 Administrator Staff Member

    30,955
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,417
    Local Time:
    3:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    update inc/cpcheck.inc nginxlargefile_fix function

    - auto calculate client_max_body_size size and auto tune in nginx.conf to largest file detected in /home/nginx/domains/*/public vhost public web roots and when the largest file detected is greater than 200 MB in size
    - the auto tuning happens every time centmin.sh menu is launched

    Continue reading...

    123.09beta01 branch
     
  2. pamamolf

    pamamolf Well-Known Member

    2,820
    253
    83
    May 31, 2014
    Ratings:
    +447
    Local Time:
    7:55 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    It may add a delay every time that i start it as i have a site with 700GB data ?

    Also there should be a limit as a user may have a huge file like 4GB but not for download and that size value will be huge ?

    Also as I try to minimize as much as possible services restarts I can’t say that I am very happy with this one...

    But I know that Centminmod can’t be exactly as everyone wants it :)

    I prefer to have a high value and adjust it manually than having every time that I run Centminmod to scan all my public folders for all my domains and adjust that value and restart Nginx :-(
     
    Last edited: Oct 9, 2017
  3. eva2000

    eva2000 Administrator Staff Member

    30,955
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,417
    Local Time:
    3:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    Indeed i have thought about limiting the scope and FYI, nginx restarts only happen if a nginx.conf change is made automatically by nginxlargefile_fix function. If not change is automatically made, there is no nginx restart.

    To test time it takes on your 700GB data site can you run these commands and provide output (you can mask the actual filename/domain)
    Code (Text):
    time find /home/nginx/domains/*/public -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 1 -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 2 -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 3 -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 4 -type f -printf '%s %p\n'|sort -nr|head -n1
    

    with >200MB limit
    Code (Text):
    time find /home/nginx/domains/*/public -size +200M -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 1 -size +200M -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 2 -size +200M -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 3 -size +200M -type f -printf '%s %p\n'|sort -nr|head -n1
    

    Code (Text):
    time find /home/nginx/domains/*/public -maxdepth 4 -size +200M -type f -printf '%s %p\n'|sort -nr|head -n1
    
     
    Last edited: Oct 10, 2017
  4. pamamolf

    pamamolf Well-Known Member

    2,820
    253
    83
    May 31, 2014
    Ratings:
    +447
    Local Time:
    7:55 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    What i mean is to do the check and if a file is larger than 200MB then just set a value and restart Nginx but don't do that again and again when it detects big files ? :(

    Doesn't look practical to me as i use a lot Centminmod menu for other tasks and i want to avoid Nginx restart every time.....

    Thank you
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,955
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,417
    Local Time:
    3:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1