Speed Up Your Server For Free: Using ZFS To Your Advantage For Access Logs
By arnaud on Jun 25, 2009
Access that can cause some performance focused users some discomfort. The one main thing usually making logs a performance hog is the fact that entries must be ordered somehow. I our products, the ordering is chronological. Here is an easy way to alleviate the issue if you're on Solaris and have a spare drive.
Bird's Eye View
ZFS Intent Log (or ZIL) can be configured on a separate disk to help synchronous performance.
So you heard about all the great benefits you can get with SSDs but don't have one yet (Go get one!) or don't have enough that you can dedicate one to your logs?
All you need to do is create a ramdisk drive that will be used for ZIL when we create our access-log-dedicated ZFS pool. Here's how:
$ ramdiskadm -a zil-drive 512m
$ zpool create log-pool c8d1 log /dev/ramdisk/zil-drive
For DPS, all you need to do is:
$ dpconf set-access-log-prop log-file-name:/log-pool/access
It's just as simple for DS, do:
$ dsconf set-log-prop access path:/log-pool/access
And OpenDS is no more complicated to configure, do:
$ dsconfig -n set-log-publisher-prop --publisher-name "File-Based Access Logger" --set log-file:/log-pool/access
OR use the interactive command, simply do:
- 20) log publisher
- 3) View and edit an existing Log Publisher
- 1) File-Based Access Logger
- 3) log-file logs/access
- 2) Change the value
- type /log-pool/access, hit return
- type "f" to finish and apply
- restart OpenDS bin/stop-ds;bin/start-ds
I know it looks like more work but the nice thing about dsconf is that it gives you context and you will get familiar with other aspects of the server
In the rare event that a server configured as described here loses power, the ZIL -being on a ramdisk- will be lost. This does not however corrupt the data stored on the disk and upon restart, all you would have to do is add the ZIL on a newly created ramdisk again. This can of course be automated to be done at boot time so that you do not need to do it yourself at every power cycle.