From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,5e76a1f92d1f60a8 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-08-03 06:26:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!news.compaq.com!news.cpqcorp.net!53ab2750!not-for-mail From: Bob Harris Newsgroups: comp.unix.tru64 Subject: Re: ADVFS and fragmentation. References: Posted-And-Mailed: yes User-Agent: MT-NewsWatcher/3.1 (PPC) Message-ID: Date: Sun, 03 Aug 2003 13:26:54 GMT NNTP-Posting-Host: 16.140.32.31 X-Complaints-To: abuse@HP.com X-Trace: news.cpqcorp.net 1059917214 16.140.32.31 (Sun, 03 Aug 2003 06:26:54 PDT) NNTP-Posting-Date: Sun, 03 Aug 2003 06:26:54 PDT Organization: Hewlett-Packard Company Xref: archiver1.google.com comp.unix.tru64:10503 In article , Bob Harris wrote: > In article , > "bofh00" 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