Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does the bare device in AIX mean?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What the bare equipment in AIX refers to, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

In AIX, each LVM device supports two modes of operation, which are abstracted as Block Device (block device) and Character Device (character device).

Where Character Device is also known as Raw Device (reasons for looking down):

For example:

# ls-l / dev/*hdisk0

Brw- 1 root system 22, 2 May 15 2007 hdisk0

Crw- 2 root system 22, 2 May 15 2007 rhdisk0

# ls-l / dev/*hd3

Brw-rw---- 1 root system 10, 7 May 15 2007 / dev/hd3

Crw-rw---- 1 root system 10, 7 May 15 2007 / dev/rhd3

Where the'c 'letter at the beginning of the file attribute represents Character, and the' r 'letter at the beginning of the file name represents Raw.

Character devices support variable-length data transfer (data transfers of arbitrary sizes) to a minimum of one byte (but by no means one byte or character at a time! ),

The single maximum I logical track group O of LVM and storage devices is only limited by the size of LTG (logical track group), which defaults to 128KB and can be modified.

Block devices can only do fixed-length data transmission, and the data must go through 'kernel buffer cache'.

This buffer cache in 512-byte block is the cache of traditional block devices, so don't confuse it with the cache of the file system!

This kind of access mode is not only inefficient, but also brings many problems, which seriously affect the performance of large data transmission.

Therefore, block devices are hardly used in modern operating systems to access the data of high-speed storage devices.

The database recommends the direct use of bare devices, which means to avoid file system and file system cache management and deal directly with character devices.

(note: the file system must be built on the character device, not on the block device)

There are three main benefits of this:

1. The code to implement each filesystem O is greatly reduced: the code for both filesystem and virtual memory for filesystem is circumvented.

two。 Avoids memory waste caused by repeated caching (both databases and file systems have their own data caches).

3. Avoids the problem of file locking: files in the file system cannot be updated by multiple processes or threads at the same time.

There are also disadvantages:

1. Lost the ease of use by managing ordinary files.

two。 Cannot take advantage of the Readahead function of the file system, and the sequential reading speed may not be optimal.

Since the advent of DIO and CIO, the performance of file system-based databases has been greatly improved.

CIO is the closest way to run a file system-based database to a bare device, because it solves two problems:

No file cache (which is the second advantage of a bare device.)

No file locks (which is 3. 3 of the advantages of bare devices).

It maintains the visibility of files, so there is no 1 of the disadvantages of bare devices.

Of course, DIO and CIO also do not support Readahead.

To sum up:

+ character devices and block devices are abstractions of two different storage modes of the same physical device.

+ the idea of bare devices is about whether there is a file system on it or not, and it has nothing to do with characters and block devices in concept.

The block buffer mechanism of + block devices and the caching of file systems are two different things.

+ block devices are basically useless in modern operating systems.

+ using bare device or file system mount with CIO for database, combined with AIO (Asynchronous Icano), can achieve the best Icano performance.

(both raw LV and CIO FS support AIO Fast Path in the new version of AIX)

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report