From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2f55c9584ad65f6a X-Google-Attributes: gidfee84,public From: Frank Durda IV Subject: Re: Slow disk writes to new hard drive Date: 2000/05/24 Message-ID: #1/1 X-Deja-AN: 626816849 Content-Transfer-Encoding: 7bit References: <39193A1A.8D64B387@gandalf.umcs.maine.edu> X-Orig-Message-ID: <392C19D7.41C67EA6@nemesis.lonestar.org> Content-Type: text/plain; charset=us-ascii NNTP-Posting-Time: Wed May 24 13:02:31 2000 Organization: Airnews.net! at Internet America NNTP-Proxy-Relay: library2.airnews.net Mime-Version: 1.0 Abuse-Reports-To: abuse at airmail.net to report improper postings Newsgroups: comp.unix.osf.osf1 Steve Cousins wrote: > I have just added an 18 Gig IBM Ultrastar SCSI drive to our Alpha Server > 800. When I access the drive it sometimes takes a very long time. For > instance, if I > > du -sk > > it will just sit there and then finally after a couple of minutes it > will report the disk usage. This on a directory that has only a couple > hundred megabytes of large files. Sounds like you are using UFS filesystems and are encountering the OSF 3.2/4.x/5.0 "we deleted disksort()" bug. Reported over three years ago, (C970207-3290) and there is still no real fix yet. (Putting the disksort() call back in or, as a better-than-nothing substitute, giving disk reads priority is apparently too hard.) The quote "solution" that appeared after two years was to use "smoothsync" which has been modified to work UFS filesystems now. You will find it in 4.0F PK3 and later. It helps a little, but the basic bug is still there and will still bite. Because of the missing disksort() call in their diskstrategy layer, the result is that the system accumulates many megabytes of stuff to write and when sync occurs, any read request (like the load of your du executable) you then issue ends-up at the very back of the list of block write operations to perform. Re-writes of the same block are not sorted-out, nor is sorting done to reduce head movement, reducing performance further and extended the time it takes all those blocks to be written-out. The result is that the system appears to stall until all the pending disk writes are completed. On a machine with a couple of GB of RAM of which UBC has easily grabbed 75% for bufs, writing all that could take a couple of minutes before it gets to I/O requests after update ran before you get a response back. Programs that got any portion of their address space paged-out or never paged-in can also block until every single write operation in the bufcache has been written to disk. If you happen to start "vmstat 1", you will notice that all of sudden cpu goes 99% idle and then vmstat stops responding for a period of time. We used to demonstrate this by running INNs makehistory, the old pathalias, or even mkpasswd with a several thousand entries, anything that would generate a lot of disk writes with no disk reads in a short span of time. Then on another terminal, wait and then as soon as update comes by, on the other session do a ls -al or something similar. Now wait. And wait. Eventually the ls -al will respond. Even if the current directory is empty it will take a while. To repeat, change directories before doing another ls as the needed blocks are now cached. Note that it takes no privs to stall the entire system, an effective denial-of-service attack method. The Compaq/Digital argument #2* against putting the disksort() back in is that everybody is using disk controllers now that are smart enough to do all that sorting for efficient disk operation, so there is no need for the OS to do it. Not everybody has HSZ-80s as their only disk device, and even then, re-writes of inode blocks and other repeatedly written blocks don't get optimized-out if the controller is having to do the work. (* Argument #1 was that UFS sucked and that everybody should use ADVFS. They have since stopped using this argument as ADVFS has its own problems.) Adding more RAM to your system simply makes the bug even more noticible since UBC will simply grow bigger and be able to accumulate more stuff before it is finally forced to start writing it all to disk. All the "smoothsync" does is issue a series of mini sync() calls, so that the I/O queue doesn't go from zero to thousands of dirty blocks all at once. Blocks get synced exactly N seconds after a program issued a write call instead on a scheduled interval. Obviously, this really doesn't address the real problem, but if you don't have a source license you are stuck with what Compaq offers. Frank Durda IV - only this address works:|"The Knights who say "LETNi" | demand... A SEGMENT REGISTER!!!" |"A what?" This Anti-spam address expires Jul 31st |"LETNi! LETNi! LETNi!" - 1983 Copr. 2000, ask before reprinting.