Connect and share knowledge within a single location that is structured and easy to search. I did a rm -rf foldername in an attempt to delete a folder containing 10,s of 25KB files. The process is taking up only 0.
But somehow the Load average is 10! Either that or you have a lot your HDD is already doing, or it is failing. Sign up to join this community. The best answers are voted up and rise to the top.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 8 years, 8 months ago. Active 8 years, 8 months ago. Viewed 4k times.
Question Why is it taking so long Almost 30 minutes? Improve this question. Nyxynyx Nyxynyx 1 1 gold badge 3 3 silver badges 14 14 bronze badges. Learn more. Slow rm -rf on linux machine Ask Question. Asked 11 months ago. Active 11 months ago. Viewed times. It is an Azure issue from my experience. Improve this question. What filesystem? What is the environment — thanasisp.
It doesn't sound too far fetched if it's a networked filesystem. A bit slow maybe, but individual unlink calls could be that slow. Good point, Kusalananda.
This is normal, if the files are in one directory and the filesystem is ext[]. Back in its days, reiserfs really beat the crap out of every other fs in this scenario, being something like times faster. I was routinely designing my major data processing scripts to take an advantage of it and filesystem with tens of thousand of small files as a quicker alternative to a database. Unfortunately, reiserfs is almost a thing of the past Add a comment.
Active Oldest Votes. Is there a way to delete many files fast without an impact on the performance of the server in general You can cheat. Improve this answer. Failing that, you just have to let it take time to delete. The machine is an Intel Core i5 2. The motherboard is an Asus P7P55D.
Edit : The machine is a Debian wheezy with Linux 3. This is how the filesystem is mounted:. A significant improvement over rm -rf , but still too much I think. Explanation of why rsync is faster than rm : "[M]ost filesystems store their directory structures in a btree format, the order [in] which you delete files is One needs to avoid rebalancing the btree when you perform the unlink Edit : I attached another disk which had 2.
Here are some comparative results:. Well this is still an Btrfs issue, that's well known that deleting many small files does take quite long time compared to other file systems. If you dislike it, you can either wait until upstream has fixed it or move on to another file system which does it better. Your main error though is using an ancient kernel 3.
Btrfs is a file system which is still under heavy development, so you should always stay with the latest and greatest kernel version to get in touch with the improvements.
If your distribution does not do backports, you can either do that yourself or you are screwed. Btrfs got many performance improvements in kernel version 3. Also take in mind that according to Chris Mason he does consider Btrfs stable by now, but not production ready yet. I'm a bit late to this party, but here's a trick to very quickly delete extremely large btrfs trees:.
The kernel is going to start reclaiming space in the background, so you won't have the available space quite immediately, but the process should be way faster than doing any sort of user-land deletion. You could rename the directory and then delete the renamed directory in a background process. This isn't going to speed up the delete operation. However, this would allow the program to continue forward with an empty directory while the delete operation is happening on the side.
I'm not sure if this is going to work in your use case. It depends if the program can't continue until the disk is idle i. It depends if the program is going to fill up the disk with a lot of data. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Learn more. Removing files takes too long Ask Question.
0コメント