Re: Can I turn off sparse file support + file extent questions
From: Eric Taylor (et2_at_rocketship1.com)
Date: 11/18/05
- Next message: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Previous message: sethturner_bb_at_hotmail.com: "any unix os guru?"
- In reply to: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Next in thread: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Reply: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Nov 2005 16:59:24 -0800
It WAS an ext3 system, fstab had this line:
LABEL=/home /home ext3 defaults 1 2
So, I took your advise and changed it to ext2.
This has TOTALLY solved the problem. In testing, I have
some 2 gig files with up to 1000 extents, and some with
as low as 16. In all cases I now achieve at least 50 MB/s
and as much as 68 MB/s. And there is no more strange
dropping off by 10x speed, EVEN in the areas where
there is heavy fragmentation. So, it must have been
the journal or something else in the 2.6 ext3 fs.
Ahhhh, you must be the Reiser of the ReiserFS fame!
Thanks, I think I can finally put this problem to rest.
And yes, this was still my checkpoint problem.I've also tried
writing to a tmpfs ramdisk, with a follow on background task to move
the file from ram to hard disk. This easily crashes my 2.6 kernel within a
few minutes, although my 2.4 system survives. I think I will revist
the ramdisk along with moving it to an ext2 filesystem and see what
happens. At any rate, 2 gigs in 40 secs is probably fast enough
for anyone other than speed freaks :)
thanks again
eric
John Reiser wrote:
> Eric Taylor wrote:
> > I am wondering if I can disable sparse file support so
> > I can preallocate a file in one quick shot. The file
> > would be approx 2 gigs in size. ...
>
> What filesystem are you using, and what are the values of its
> tunable parameters? For example, on many installations the
> default filesystem is ext3 with journalling option "journal",
> the safest but slowest choice: changes to both data and metadata
> are journaled (written at least twice, with sequence points
> that insure the order of physical writes to the disk.) The other
> choices are "ordered" which journals the metadata, does not journal
> the data, but forces data writes to precede metadata writes; and
> "writeback", which journals the metadata, does not journal the data,
> and does not force data writes to precede associated metadata writes.
> You can change the mode at mount time, such as within /etc/fstab.
> See: http://www.linuxplanet.com/linuxplanet/reports/4136/5/
>
> The metadata for a file on ext3 grows logarithmically as the
> size of the file. For a blocksize of 4KB (the default unless
> the filesystem is <= 2GB or so], then the first 10 blocks
> have cost 1, the next 1024 have cost 2, the next 1024*1024
> have cost 3, the final 1024*1024*1024 have cost 4. Thus full
> journalling costs [at least] 3 times as much from about 4MB
> to about 4GB, as below 40KB.
>
> If these 2GB files are your simulation checkpoints, then
> DO NOT USE A JOURNALLED FILESYSTEM. At least: go back to ext2
> [no journal]. Even better: choose a filesystem that allocates
> by "arbitrary"-sized extents. ext2 and ext3 are essentially
> block based: they allocate individual blocks from a bitmap.
> Although there are policies and heuristics to encourage
> consecutive allocation, it is not guaranteed. Your 2GB file
> can easily have _lots_ of single-block extents. Also, the maximum
> extent is 32768 blocks (one 4KB block of allocation bits),
> which is only 128MB.
>
> On ext2 or ext3 there is no way to preallocate blocks
> for a new file; you have to write them. It many respects
> it would be reasonable for truncate(), ftruncate(), truncate64(),
> ftruncate64() to preallocate; but currently they do not.
>
> -
- Next message: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Previous message: sethturner_bb_at_hotmail.com: "any unix os guru?"
- In reply to: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Next in thread: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Reply: John Reiser: "Re: Can I turn off sparse file support + file extent questions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|