deleting file takes longer than creating it

Stroller stroller at stellar.eclipse.co.uk
Wed May 5 10:58:57 CDT 2010


On 5 May 2010, at 15:05, Andrew Reid wrote:

> Stroller wrote:
>>  Ou of curiosity, is there a reason you didn't do
>>  `time dd if=/dev/zero of=zero.txt bs=1024 count=1000000 && time rm
>> zero.txt` ?
>
> Simple reason, insufficient caffiene; I copy and pasted the command  
> line
>   I used to test the commnad and then partially editted it to use the
> OP's file name.

I wasn't replying to you, but the OP. :P

I was asking HIM why he did it that way.

I had already started writing my reply when your message arrived.

> On an xfs filessystem this gives:

XFS doesn't have the notorious slow-deletes problem of ext3, though.

 From my tests:

ext3 (c 700mhz Pentium III):

$ time dd if=/dev/zero of=zero.txt bs=1024 count=1000000 && time rm -f  
zero.txt
1000000+0 records in
1000000+0 records out

real	0m37.564s
user	0m0.820s
sys	0m24.280s

real	0m2.266s
user	0m0.000s
sys	0m0.150s
$

ext4 (c 2.4ghz Pentium 4, 3ware RAID controller):

$ time dd if=/dev/zero of=zero.txt bs=1024 count=1000000 && time rm  
zero.txt
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 187.476 s, 5.5 MB/s

real	3m7.512s
user	0m1.534s
sys	0m33.121s

real	0m3.221s
user	0m0.001s
sys	0m0.941s
$

These are difference machines, but it looks to me like the ext3  
machine is a chunk slower (relatively) at the deletion than the ext4  
machine.

However, the delete is still faster than the write, so I guess this  
isn't the root of John's problem.

I haven't messed with the caches thing, because I don't understand  
filesystem performance enough to pretend to be able to benchmark with  
a great deal of accuracy. Maybe I'll have to learn about that one day,  
but right now I don't really care.

Stroller.



More information about the Linux-PowerEdge mailing list