Learn about Centmin Mod LEMP Stack today
Register Now

Sysadmin What is the quickest way to delete a LARGE folder?

Discussion in 'System Administration' started by rdan, Oct 9, 2022.

  1. rdan

    rdan Well-Known Member

    5,419
    1,386
    113
    May 25, 2014
    Ratings:
    +2,167
    Local Time:
    12:12 AM
    Mainline
    10.2
    It's large in terms of size, like 700GB+, and also has lots of content, I think more than 500K files.


    This folder is just a Nginx fascgi_cache folder, but the cache is stored for 60 days.

    The server is using a spinning HD, and doing rm -rf takes hours but hasn't even finished yet, causing the whole site to lag.
     
  2. cloud9

    cloud9 Premium Member Premium Member

    388
    108
    43
    Oct 6, 2015
    England
    Ratings:
    +200
    Local Time:
    5:12 PM
    1.23.2
    10.6.x
  3. rdan

    rdan Well-Known Member

    5,419
    1,386
    113
    May 25, 2014
    Ratings:
    +2,167
    Local Time:
    12:12 AM
    Mainline
    10.2
    Thanks, I was thinking about rsync but haven't tried it yet.
    I will try again later on non peak hours.
     
  4. eva2000

    eva2000 Administrator Staff Member

    50,481
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,092
    Local Time:
    2:12 AM
    Nginx 1.25.x
    MariaDB 10.x
    Nice article - thanks for sharing :)

    Ouch. Maybe better just to put Cloudflare in front of the site and utilise Cloudflare Tiered Caching and Cache Rules
     
  5. rdan

    rdan Well-Known Member

    5,419
    1,386
    113
    May 25, 2014
    Ratings:
    +2,167
    Local Time:
    12:12 AM
    Mainline
    10.2
    Yes I am :D.
    But sometimes I need some major changes on the backend that I also need to purge all the cache (server side and CF) and it's pain for the main server for several hours until the cache build up.
     
  6. rdan

    rdan Well-Known Member

    5,419
    1,386
    113
    May 25, 2014
    Ratings:
    +2,167
    Local Time:
    12:12 AM
    Mainline
    10.2