Learn about Centmin Mod LEMP Stack today
Register Now

Beta Branch update inc/downloads.inc & centmin.sh php geo locale support

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jan 15, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    54,894
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    7:48 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    update inc/downloads.inc & centmin.sh php geo locale support


    add routine to check server country location and use php.net's mirror url system to use a php download location closest to the server country. If country is not detectable fall back to default USA php.net download url

    Continue reading...

    123.09beta01 branch
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,894
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    7:48 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Testing php geo location matching for PHP upgrades. Had to add a few more commits to 123.09beta01 to fix this routine and got it working on local virtualbox CentOS 7.2 64bit OS

    with php geo location matching my AU = Australian location
    Code:
    *************************************************
    * Upgrading PHP
    *************************************************
    AU server detected
    Initializing download: http://au1.php.net/get/php-5.6.17.tar.xz/from/this/mirror
    File size: 11575424 bytes
    Opening output file php-5.6.17.tar.xz
    Starting download
    
    Connection 1 finished                                                          ]
    Connection 3 finished                                                          ]
    Connection 0 finished                                                          ]
    [100%] [..................................................] [   5.7MB/s] [00:00]
    
    Downloaded 11.0 Megabyte in 1 second. (5868.02 KB/s)
    without php geo location match it uses default USA php.net mirror and is much slower 1/10th speed to Australia 1s vs 20 seconds !
    Code:
    *************************************************
    * Upgrading PHP
    *************************************************
    Initializing download: http://php.net/get/php-5.6.17.tar.xz/from/this/mirror
    File size: 11575424 bytes
    Opening output file php-5.6.17.tar.xz
    Starting download
    
    Connection 2 finished                                                          ]
    Connection 0 finished                                                          ]
    Connection 1 finished                                                          ]
    [100%] [..................................................] [ 539.8KB/s] [00:00]
    
    Downloaded 11.0 Megabyte in 20 seconds. (539.83 KB/s)
    here's any idea of how long it takes just to download 123.09beta01.zip from Australia = yes ~46 seconds

    Code:
    time wget https://github.com/centminmod/centminmod/archive/123.09beta01.zip
    --2016-01-15 13:16:39--  https://github.com/centminmod/centminmod/archive/123.09beta01.zip
    Resolving github.com (github.com)... 192.30.252.129
    Connecting to github.com (github.com)|192.30.252.129|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://codeload.github.com/centminmod/centminmod/zip/123.09beta01 [following]
    --2016-01-15 13:16:40--  https://codeload.github.com/centminmod/centminmod/zip/123.09beta01
    Resolving codeload.github.com (codeload.github.com)... 192.30.252.163
    Connecting to codeload.github.com (codeload.github.com)|192.30.252.163|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 51565350 (49M) [application/zip]
    Saving to: ‘123.09beta01.zip’
    
    100%[================================================================================================================================================================================================================>] 51,565,350   576KB/s   in 44s
    
    2016-01-15 13:17:25 (1.12 MB/s) - ‘123.09beta01.zip’ saved [51565350/51565350]
    
    
    real 0m46.192s
    user 0m0.761s
    sys  0m1.934s
    shame github.com downloads don't have mirrors closer to Australia heh