Hi, > -----Original Message----- > From: Flemming Frandsen [mailto:[EMAIL PROTECTED] > Sent: Dienstag, 1. April 2003 11:29 > To: SAPDB > Subject: Raw devices vs normal devices > > > Conventional wisdom has it that DBMSes do internal caching > and are very > smart about doing IO, so any caching/buffering the OS does is > wasted and > actually leads to worse performance. > > On Linux (2.4.18, SuSE 8.1) direct access to underlying disks is done > via special raw devices and some restrictions apply (RAW(8) man page): > > Because raw I/O involves direct hardware access to a > process's memory, a > few extra restrictions must be observed. All I/Os must be correctly > aligned in memory and on disk: they must start at a sector offset on > disk, they must be an exact number of sectors long, and the > data buffer > in virtual memory must also be aligned to a multiple of the sector > size. The sector size is 512 bytes for most devices. > > > Is raw IO supported on Linux?
It is not just for Linux but for all platforms. The first versions of the 'very special' raw device driver in Linux had problems with our 8K pages, but the raw device driver in Linux has become stable by now.... How does it work? For SAPDB all data cache pages are aligned as needed. The alignment is 8K (size of data page) if system page are 8K or larger (i.e. 16KB system pages on Reliant Unix) and 4K for system pages of 4K. It would not be possible to use a 'malloc'ed memory area to do raw device I/O ! All cache pages are allocated by 'valloc()/mmap() or VirtualAlloc()' which all enforce system page alignment. Since the cache pages are allocated in big chunks at start of database, the overhead of the 'valloc()' calls is neglectable. Theoretically spoken we would only run into problems, if the raw device alignment needed would be larger than the system page aligment or the cache page alignment whichever is smaller... but the current disks need 512 bytes as you mentioned. By the way, there is no common OS feature that allows you to interrogate the device about its aligment need. Only the preferred page size of the OS file system cache is available... When the disks run that big, that raw access needed i.e. 64K aligned pages, we will spend an extra configuration parameter... CU jrg _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
