How do you solve slow file deletion on ext4?

this guy chias :slight_smile:

Regarding the slow file deletes. um… fragmentation? I only have one ext4 node but it’s quite fragmented and performance for things like listing files has gotten really bad.

using more ram for file caching may help some. the other ext4 optimization that I can think of is potentially shrinking inode size?

I did a dumber test to attempt to confirm:

actually, right now - while I have a rclone running in the background - if I attempt to “ls” a single folder it takes like…two minute and 21 seconds. That is, the first time. The second time is near instant presumably because it’s in cache.

I did another low key test.

  1. traversed into a previously unscanned storj folder.
  2. used touch to create the files ‘hi’ and ‘hi2’
  3. creation was instant
  4. did a rm hi?
  5. took over a minute.
  6. but doing an ls was faster.

So maybe there is a way storj can delete the files without having an implicit re-listing of the files? I’m not smart enough with the filesystem or with programming to know if that’s possible.

incidentally I’ve switched other drives to zfs. having a lot of ram for cache plus experimenting with metadata cache on ssd it doesn’t seem to have these particular problems.