Get the most out of your Centmin Mod LEMP stack
Become a Member

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,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    8:45 PM
    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 Active Member

    437
    118
    43
    Oct 6, 2015
    England
    Ratings:
    +221
    Local Time:
    1:45 PM
    1.25.3
    10.6.x
  3. rdan

    rdan Well-Known Member

    5,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    8:45 PM
    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

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:45 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    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,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    8:45 PM
    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,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    8:45 PM
    Mainline
    10.2