it takes 5 seconds to copy 20M files from one directory to another.However it only takes no more than 1 second in the ext2 filesystem. --http://www.eyou.com --Îȶ¨¿É¿¿µÄÃâ·Ñµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢...ÒÚÓÊδ¾¡
it takes 5 seconds to copy 20M files from one directory to another.However it only takes no more than 1 second in the ext2 filesystem. --http://www.eyou.com --Îȶ¨¿É¿¿µÄÃâ·Ñµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢...ÒÚÓÊδ¾¡
Li Chengyuan wrote:> > it takes 5 seconds to copy 20M files from one directory to another.However it > only takes no more than 1 second in the ext2 filesystem. >Sometimes it just seems that way, but it's not really so. When you copy the files with ext2, all the written data is left in memory for up to thirty seconds. So if you run time cp -r dir1 dir2 then all you hve measured is the time to read the files, not the time to write them. Try this: time (cp -r dir1 dir2 ; sync ) and you'll see that the two are closer. The reason for this is that ext3 only leaves write data in memory for up to five seconds, not thirty.
hi: thanks for answer.But in fact i set up a ramdisk of 30M with ext2 filesystem, and also copy the file(20M) in ext3 filesystem to ram disk.it will take 5-6 second.while in ext2 filesystem, only 1-2 second is taken.So i want to konw the reasons. thanks. X.C. --http://www.eyou.com --Îȶ¨¿É¿¿µÄÃâ·Ñµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢...ÒÚÓÊδ¾¡