From: Bob Harris <harris@zk3.dec.com>
Subject: Re: ADVFS and fragmentation.
Date: Sun, 03 Aug 2003 13:26:54 GMT [thread overview]
Message-ID: <harris-4075FA.09273103082003@juggl7.zk3.dec.com> (raw)
In-Reply-To: harris-0A0ABF.22435701082003@juggl7.zk3.dec.com
In article <harris-0A0ABF.22435701082003@juggl7.zk3.dec.com>,
Bob Harris <harris@zk3.dec.com> wrote:
> In article <pan.2003.08.01.17.53.28.327019@aero-graphics.com>,
> "bofh00" <jnielsen@aero-graphics.com> wrote:
>
>> One oddity I have noticed relates to raster files. We regularly
>> deal with large imagery 100mb-1gb. These files no matter how
>> fragmented the system becomes tend to remain fairly contiguous and
>> according to "showfile -x" retain their Advfs I/O effeciency and
>> keep a lower number of extents. This does not apply to most data
>> generated from these images.
>>
>> We also generate pyramid data sets of the images which basically
>> are the same image but resampled to multiple resolutions
>> all contained within one file. Each "level" if you will is used
>> for zooming into the image. These pyramid files themselves always
>> have extrememly poor Perf and Extents listings according to
>> "showfile -x".
I have one other thought after re-reading this.
If there is only 1 pyramid file generated per original image and only
one process, is it possible that the generating program creates the
pyramid file as a sparse file initially, and fills in the different
resolutions a raster line at a time?
That is to say, the pyramid program calculates how much space will be
needed for each resolution, and decides on the offsets in the file that
each resolution will start.
Then the pyramid program reads each raster line of the original image,
and generates the 'n' different resolutions for that one raster line and
writes each resolution to its assigned offset in the file. It then
reads the 2nd raster line and generates all the resolutions and writes
those, etc...
Now maybe it reads 10 raster lines and generates each resolution.
I'm not trying to explain an algorithm I haven't clue about, but
trying to see if there is a pattern of data writing.
Anyway, if the program that builds the pyramid file uses lseek to write
the file, then that too would cause the file to appear fragmented. This
is because each sparse write to the file would allocate storage and the
storage would be allocated from the next available free space, but it
would be used in a non-contiguous manor.
There is no cure for this type of program behavior, short of rewriting
the program.
The simple rewrite would be to process each resolution one at a time so
that the pyramid file grows sequentially. The problem I see with this
is that it would entail re-reading the original 100MB to 1GB image file
over and over again. This could be a performance problem.
Another approach would be to write each resolution to a separate work
file and play some of the games I suggesed in my previous post of having
each work file go to a different volume or a different domain so that
they would no be fighting to get the same free space. After all the
resolutions have been created, then recombine them into one file. This
would reqire rereading and writing the resolution files, but it would
only be 1 pass vs the re-reading of the original huge image once per
resolution.
One more approach, create a fully allocated (by empty) pyramid file and
then write the resolutions. That is to say, first calculate the fully
populated size of the pyramid file, then sequentially write zeros to the
file (in large writes) until it is fully created and has allocated all
its storage. Now have the program that creates the pyramid file lseek
and overwrite the zeros with real data. This may be the most efficient
for creating a more contiguous file in that it only means 1 extra write
pass, with out any extra read passes and no extra time for AdvFS to
allocate extra space for work files that would be deleted.
Again, I am guessing at why your pyramid files are always fragmented,
even on mostly empty domains. The algorithms I have put forth I wild
guesses. In reality, they are most likely totally different from what
I've speculated. And I'm not trying to tell you the best way to
generate your pyramid files, I'm just trying to provide working ideas
that you can evaluate if they might be useful to you.
And again, I will ask. Does this existing pyramid file fragmentation
actually hurt your performance? If it does not, then it is not worth
trying to change the way they are written, just to make them contiguous.
Bob Harris
next prev parent reply other threads:[~2003-08-03 13:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-31 15:26 ADVFS and fragmentation bofh00
2003-08-01 17:53 ` bofh00
2003-08-02 2:43 ` Bob Harris
2003-08-03 13:26 ` Bob Harris [this message]
2003-08-04 14:24 ` bofh00
2003-08-02 1:23 ` Jack Patteeuw
2003-08-04 14:19 ` bofh00
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox