Re: Chunk Writes
Posted in 1997
In article <664me0$99u@cssun.mathcs.emory.edu>, Mark Collins <mcollins@us.dhl.com> writes >> I have been reading the "online Dyn. Server Sys. Adm 1" training >> mtrl -by Cindy Lee Dowling,Elizabeth Suto. >> >> Chapter 10 -270 which discusses Chunk Writes. >> >> it says " All modified buffers are flushed to disk.The page cleaner >> threads read thro' the buffer headers looking for pages associated with >> their chunk .At the end of this process , the page cleaner threads sort >> all of the pages into Disk Sequence by page numbers and writes this >> sequence to disk .This is known as Sorted Write , and it minimises disk >> seek time during checkpoint .the writes performed by page cleaners at >> Checkpoint time are known as Chunk Writes" >> >> Now , Does that mean a sequence is written to disk first and then >> the pages? Could someone distinguish between Sorted writes and Disk >> Writes. > >In this phase of the checkpoint, only the dirty buffers are written to disk. >Other things >are written to disk both before and after this step, as is documented in the >Dynamic Server >Database Server Administrator's Guide Version 7.2 pg. 12-55. > >When they say the pages are sorted in "Disk Sequence" it is a little misleading. >Actually, >they are sorted based on page number, and page number is composed of chunk >number and page >offset within the chunk. Then all of the pages for a chunk are written by a >single page >cleaner in order within that chunk, which is where the term "Chunk Write" comes >from. >Chunk write and sorted write are the same thing. > >Assume, for argument sake, that you have 14 chunks spread across 4 disks and >that, based a >fairly common rule-of-thumb you have 4 page cleaners. Also assume that each of >the 14 >chunks has some dirty pages in the buffer cache. The pages for chunk 1 will be >assigned to >page cleaner 1, chunk 2 to page cleaner 2, and so on until all four cleaners are >assigned. >The first cleaner to finish its assigned chunk will then be assigned chunk 5, >and on and on >until all pages have been written to disk. Depending on the distribution of the >chunks on >the disks, you can have multiple page cleaners writing to the same disk, which >does result >in contention. This is almost (I'm tempted to leave out the word "almost") >unavoidable. > >Short of actually checking for disk name and then chunk offset within disk, >there really is >no way to ensure that writing is actually done completely in sequence across the >entire >disk. Even at that, when you consider logical volumes, disk arrays, disk >sections, etc., I >doubt that you could ever develop a method that would completely guarantee >writes to occur >in perfect order across all platforms. > Use 2Gb disks, 1 disk = 1 chunk = 1 dbspace. Also allows use fragmentation across disks. You fragment across dbspaces and therefor automatically across disks... > > > > >Mark Collins >mcollins@us.dhl.com > >The problem lies in how easily and dangerously we forget that >manipulating things is not the same as understanding them. > > -- David Williams