deleting file takes longer than creating it

Jeff Hanson jhanson at sgi.com
Wed May 5 09:13:58 CDT 2010


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` ?
>  >
>  >> This machine is serving as a print server, debian package mirror, 
>  >> and a
>  >> mmysql database server. I am not sure what kind of info you might 
>  >> need to
>  >> help me. But for starters, I'm running debian lenny with a 2.6.30 
>  >> kernel.
>  >> The file system is ext3.
>  >
>  > I'm not saying this is wholly the reason, but ext3 is notoriously slow 
>  > at deletions.
>  >
>  >
> 
> 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.
> 
> For clarity the correct test is:
> 
> dd if=/dev/zero of=zero.txt bs=1024 count=1000000; sync; echo 3 >
> /proc/sys/vm/drop_caches ; sleep 15 ; time rm zero.txt;
> 
> 
> On an xfs filessystem this gives:
> 
> 1048576+0 records in
> 1048576+0 records out
> 1073741824 bytes (1.1 GB) copied, 11.3907 s, 94.3 MB/s
> 
> real    0m0.023s
> user    0m0.000s
> sys     0m0.000s
> 
> 
> 11 seconds create, 23 ms delete. YMMV

Randomly chose ext3 filesystem gives

time dd if=/dev/zero of=zero.txt bs=1024 count=1000000; sync; echo 3 > /proc/sys/vm/drop_caches ; sleep 15 ; time rm -f zero.txt
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 19.9531 seconds, 51.3 MB/s

real    0m20.603s
user    0m0.525s
sys     0m5.958s

real    0m1.576s
user    0m0.001s
sys     0m0.073s
-- 
-----------------------------------------------------------------------
Jeff Hanson - jhanson at sgi.com - Field Technical Analyst

You can choose a ready guide in some celestial voice.
If you choose not to decide, you still have made a choice.
You can choose from phantom fears and kindness that can kill;
I will choose a path that's clear
I will choose freewill. - Lee/Lifeson/Peart



More information about the Linux-PowerEdge mailing list