Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.wizards Subject: Re: Raw disk I/O Message-ID: <1990Feb18.004830.13853@virtech.uucp> Date: 18 Feb 90 00:48:30 GMT References: <1990Feb15.212708.19046@ladc.bull.com> Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill) Organization: Virtual Technologies Inc., Sterling VA Lines: 55 In article <1990Feb15.212708.19046@ladc.bull.com> fmayhar@hermes.ladc.bull.com writes: >In article , marc@focsys.uucp (Marc H. >Morin) writes: >> I am investigating using the raw disk interface to increase performance >> of our application. The application is an imaging system, thus the I/O >> consists of large data transfers to and from the disk. >> 3) Any experiences that you might have had with raw disk I/O. > >We were looking into this as well. After testing, we decided to >continue to use >the block device, since it was at least three times faster than the raw device. This kind of conclusion is very dependent upon the way you are using the data on the device and on the specific device driver itself. On most systems, if you have a single process that is reading very large sections of the disk drive, you will get better performance by using the raw partition. For example: I wrote a program that restores a database file to a disk partition (not to the filesys, the database used the disk partition directly). Initially in restoring 300MB from tape to disk using the block partition, it took almost 3 hours to restore the data and the performance on the system while this was going on was real slow. When I changed it to use the raw device, the same restoration took only 45 minutes and it had almost no effect on system performance. Some of the matters to consider are: 1. How much data are you reading/writing at a time. If you are only accessing small amounts (remember i/o to a raw partition must be a minimum size depending on the device, usually 512 or 1024 bytes), you probably would get better performance from the block device. However, using the block device will be a performance gain over using a larg file in a file system since no block indirection will take place, the data blocks will be shared amongst processes, and delayed writes will be utilized. 2. Will multiple processes be accessing the same data? If they are accessing the same data frequently, the buffer caching available on the block device should inprove performance. >Of course, we're using System V. I think you'll probably see the same thing >under BSD, though. This isn't a SV vs BSD thing, it is a driver vs driver, hardware vs hardware thing. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+