ablog

不器用で落着きのない技術者のメモ

Oracle の ASMLib について

ASMLIB Performance vs Udev | Ardent Performance Computing を読んでみて、脳内の想像バッファをブログにアウトプットしてみる…
raw デバイスファイルシステムを経由しないので、オーバーヘッドが少なく高速になる。ただし、1ファイル=1デバイスになるので、後から増設しずらい、アーカイブログ領域には使えない*1など融通がきかない。そこで出たのがASM。ファイルシステムを経由しないでディスクにアクセスするので高速かつファイルシステムのような使い勝手で、アーカイブログ領域などにも使える。

Kernel 2.4 では raw デバイスまわりの設定が快適じゃなかったので、ASMLib を作った。その後、Kernel 2.6 では udev になって解消され、ASMLib の存在価値が薄れたということか。

でも、ASMLib のボリューム名に好きな名前をつけれる機能は便利だと思う。rawデバイスだと、raw1、raw2 ... みたいなデバイス名なので、間違いそうで神経を使う。

以下は ASMLIB Performance vs Udev | Ardent Performance Computing からの引用。

  • 結論

So right now my preference would be to only install asmlib on old systems - Oracle 10.1 or Linux 2.4 - but to use udev and block devices for 10.2 and newer on 2.6 kernels.

  • メリット

It seems to me that the ASMLIB API was originally introduced to do more than just simplify file permissions - sounds like it was an alternative I/O API to the standard unix one, allowing ASM to access the underlying storage more efficiently and completely.
...

  • always uses direct, async i/o
  • solves persistent device naming, even if underlying device moves across reboots
  • solves file permissions and ownership
  • reduced user mode to kernel mode context switches during I/O, possibly reducing CPU usage
  • reduced file handle usage
  • pass metadata such as I/O prioritization to storage device (don’t think this is -implemented in the Linux version)
  • デメリット

However from what I can tell, the ASMLIB API didn’t quite catch on.
...
A RedHat consultant I’m working with recommended against using it and one of his reasons was that it introduces an unnecessary additional layer and dependency in the kernel. There have been a small number of past bugs in asmlib and it doesn’t seem to be frequently updated (once this year according to the changelogs)…

以下は Project Documentation: ASMLib Kernel Driver - oss.oracle.com からの引用。

ボリュームを作成する。

# /etc/init.d/oracleasm createdisk VOL1 /dev/sdg
Creating Oracle ASM disk "VOL1"                            [  OK  ]

ボリュームを削除する。

# /etc/init.d/oracleasm deletedisk VOL1
Deleting Oracle ASM disk "VOL1"                            [  OK  ]

一覧表示する。

# /etc/init.d/oracleasm listdisks
	VOL1
	VOL2
	VOL3

*1:1ファイル=1デバイスなので、新規にファイル作成されてファイルが増えていくような領域には使えない。