Is asmlib obsolete on a modern Linux system? I’m still undecided but starting to lean toward “yes”.
Everybody knows that asmlib was very useful when it was first introduced with Oracle 10.1 to simplify a host of issues on Linux: direct async device access without raw devices, file permissions & ownership without custom code, and persistent device naming without devlabel.
But I’m now involved in setting some standards to be used across a large organization for Oracle 10.2 on RHEL5 and I’m wondering if there’s still a case for using asmlib. So I did a little trolling for info – which was suprisingly sparse. Had a hard time finding much, but after a lot of digging I think I’ve compiled a useful bit of information about benefits and drawbacks.
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. I don’t think it’s just an “extra layer” – it’s an alternative code path to the std unix I/O libs. Like an ODM for block devices – and the idea was that there could be additional vendor implementations. And Oracle released an initial generic implementation on Linux under the GPL.
Some theoretical benefits of ASMLIB API:
- 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. Wim recommends it (as of Apr ’07) but Closson doesn’t really talk about it on his blog but has one disparaging off-hand reference about pitying people who use it. There have been no vendor implementations that I could find. (But I wonder what’s going on now with exadata and “iDB” which has I/O prioritization and predicate pre-filtering – could they have used the API here?) Wim’s post on Oracle Forums says that there isn’t “much of an io performance benefit” added by the linux ASMLIB implementation. And the OTN page hasn’t been updated for almost two years.
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)… but then it’s very simple code (mostly in a single small file).
After all of this, I’m not convinced that it’s worth installing ASMLIB if you’re comfortable with udev. On Linux, udev is definitely a better solution to handle persistent device naming and permissions and I don’t see enough benefits in asmlib to outweigh the very slight additional overhead.
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. But the case isn’t closed and I’d love to hear from anyone who agrees or disagrees… thoughts?
- Wim’s brief remarks on Oracle Forums – http://forums.oracle.com/forums/thread.jspa?threadID=498215
- In-depth information from ASM reference book – http://books.google.co.uk/books?id=HB453L86Q6AC&pg=RA1-PA142&lpg=RA1-PA142&dq=asmlib+api&source=web&ots=bEP4epFbp5&sig=47aLUWW9o73Snr1tcnvz_1h3prU&hl=en&sa=X&oi=book_result&resnum=1&ct=result#PRA1-PA142,M1
- Uses submit_bio() call – source code – http://oss.oracle.com/viewvc/oracleasm/trunk/kernel/driver.c?view=markup
- cdos newsgroup thread with speculation about performance – http://groups.google.com/group/comp.databases.oracle.server/browse_thread/thread/905296d0aba00b84?pli=1
- tim hall was going to investigate though he didn’t publish results – http://www.oracle-base.com/blog/2006/05/01/asm-with-asmlib-or-raw-devices/
- kevin closson doesn’t say much but makes this off-hand remark – http://kevinclosson.wordpress.com/2006/11/02/dbwr-efficiency-aio-io-libraries-with-asm/
- short anonymous comment possibly by closson – http://archives.devshed.com/forums/databases-124/asmlib-1157660.html
- OTN official site for ASMLIB – http://www.oracle.com/technology/tech/linux/asmlib/index.html