Xsan 2: Optimizing file system journal size
Summary
Xsan versions earlier than 2.2 defaulted to creating a file system journal of 16 MB, which is a reasonable default for many Xsan volumes. There may be circumstances in which this journal size may be insufficient and hamper performance in file system operations, especially ones involving metadata. Increasing the journal size may improve performance of file system operations. Changing the journal size for an Xsan volume can be done without recreating the volume. You should first back up your Xsan configuration on your metadata controllers, back up any data, and test the changes in a test environment before implementing them in a production environment.
Xsan 2.2 automatically includes this change in the volume Journal when the volume is created, but this process will still be valid if you wish to manually tune the journal size.
Products Affected
Xsan 2, Xsan 2.1, Xsan 2.2
First, find the initial journal size to test:
| Block Size | Journal Size |
| 4 KB, 8 KB, or 16 KB | 16 MB |
| 32 KB | 32 MB |
| 64 KB | 64 MB |
| 128 KB | 128 MB |
| 256 KB | 256 MB |
| 512 KB | 512 MB |
Then, use the following process to change the Journal size of the volume:
- Unmount the volume from all Xsan clients and controllers.
- Stop the volume.
- Make a copy of the volume configuration file with the following Terminal command. You should do this on each controller as the configuration file is what defines your volume.
sudo cp /Library/Filesystems/Xsan/config/MyVolume.cfg /Library/Filesytems/Xsan/configMyVolume.cfgbackup
- Edit the configuration file with your preferred text editor. Editing this file requires root privileges, so if you are editing the file with a Terminal-based text editor such as 'vi' or 'pico', you'll need to use sudo.
sudo vi /Library/Filesystems/Xsan/config/MyVolume.cfg
or
sudo pico /Library/Filesystems/Xsan/config/MyVolume.cfg
- Change the JournalSize parameter in the configuration file to the desired size in the table. Please note that the size is in megabytes and the size should end with "M".
# ************************************************************
# A global section for defining file system-wide parameters.
# ************************************************************
[...some configuration parameters removed for brevity...]
BufferCacheSize 32M
JournalSize 16M
FsBlockSize 64K
After changing the JournalSize:
BufferCacheSize 32M
JournalSize 64M
FsBlockSize 64K
- Copy the new configuration file to all other controllers. You can use Apple Remote Desktop, AFP, or another file sharing method to accomplish this.
- Execute this Terminal command from the primary controller:
sudo cvupdatefs MyVolume
You should see output such as this:
Re-creating File System cvfsck Directory '/Library/Filesystems/Xsan/data/MyVolume/trace'. The following changes have been detected in the configuration Please review these changes carefully. Stripe Group Name Stripe Status MetaData Journal ================= ============= ======== ======= MetadataAndJourna No Change No Change Resize Data No Change This will modify the file system "MyVolume". Are you sure you want to continue? [y/N] y Attempting to acquire arbitration block... successful. Flushing journal entries... done Freeing old journal space... Allocating new journal space... Flushing buffers... Updating ICB information... Updating SuperBlock information... *Warning*: File system 'MyVolume' was modified.
- Start the volume. You should review the system and volume log to ensure there are no issues.
- Mount the volume on all Xsan controllers and clients.
- Test to see if there were any changes to the volume performance. If the volume performance did not improve, you may wish to consider changing the volume to a different size. Although you can set a size larger or smaller than the recommended size, best practice is to not set the journal size to less than the recommended value.
Twitter
Facebook