Welcome to Centmin Mod Community
Register Now

optimise-images.sh speed

Discussion in 'Web Development & Web Performance' started by syn, May 14, 2019.

  1. syn

    syn New Member

    9
    2
    3
    Aug 15, 2018
    Ratings:
    +2
    Local Time:
    4:31 AM
    Hi.
    I was testing optimise-images.sh for optimize a bunch of jpg images.
    Using this code:
    Code:
    find /home/testsubdir/ -type d | sort | while read d; do echo "optimise directory: $d"; echo "/root/tools/optimise-images.sh optimise $d"; /root/tools/optimise-images.sh optimise $d; done
    a) 1,596 files - 100 directories, took 3min40sec for procesing it.
    Code:
    UNATTENDED_OPTIMISE='y', IMAGICK_RESIZE='y'
    b) 1,596 files - 100 directories, took 3min38sec...
    Code:
    UNATTENDED_OPTIMISE='y', IMAGICK_RESIZE='n'
    I want just optimize the images no resize. Any another option for make it faster?
    There's no problem with cpu/disk io.

    My plan is optimize more than 1,227,225 files... but with that speed...
     
  2. eva2000

    eva2000 Administrator Staff Member

    42,383
    9,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,750
    Local Time:
    6:31 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  3. eva2000

    eva2000 Administrator Staff Member

    42,383
    9,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,750
    Local Time:
    6:31 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  4. syn

    syn New Member

    9
    2
    3
    Aug 15, 2018
    Ratings:
    +2
    Local Time:
    4:31 AM
    This code is valid too?
    Code:
    find /home/testsubdir/ -type d | sort | while read d; do echo "optimise directory: $d"; echo "/root/tools/optimise-images.sh optimise-cron $d"; /root/tools/optimise-images.sh optimise-cron $d; done
    3min23sec not a huge difference.
     
  5. eva2000

    eva2000 Administrator Staff Member

    42,383
    9,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,750
    Local Time:
    6:31 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yup - test on a test directory and see
     
  6. syn

    syn New Member

    9
    2
    3
    Aug 15, 2018
    Ratings:
    +2
    Local Time:
    4:31 AM
    Thanks.
    Completion Total Time: ~156,094 seconds :jawdrop:
     
  7. eva2000

    eva2000 Administrator Staff Member

    42,383
    9,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,750
    Local Time:
    6:31 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    maybe geographic number format but is that 156.094 seconds or 156,904 thousand seconds you mean for 1,227,225 files ?
     
  8. syn

    syn New Member

    9
    2
    3
    Aug 15, 2018
    Ratings:
    +2
    Local Time:
    4:31 AM
    ~156k seconds for 1,2M files. I will setup that cron tonight :nailbiting:
     
    • Like Like x 1
  9. eva2000

    eva2000 Administrator Staff Member

    42,383
    9,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,750
    Local Time:
    6:31 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x