Ext3 and RAID Performance Tuning

A place for discussion of topics that are not specific to ZoneMinder. This could include Linux, Video4Linux, CCTV cameras or any other topic.
Post Reply
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Ext3 and RAID Performance Tuning

Post by knight-of-ni »

EXT3 Tuning

In my quest to make my system run as efficient as can be, I learned the following options can be added to your fstab for any ext3 filesystem:

noatime
commit=120
data=writeback

So if you dedicate an entire disk to your Zoneminder events then your fstab entry may look something like this:

/dev/{your disk} /var/www/html/zm/events ext3 defaults,noatime,commit=120,data=writeback 0 2

I recommend you google these parameters and learn what they do before you set them. In particular if you are running Ubuntu, you should read the following and pay attention to the extra steps one may have to take in order to get "data=writeback" to work on your root filesystem:

http://ubuntuforums.org/showthread.php?t=107856

RAID Tuning

If your Ext3 filesytem is on a raid volume then you can tweak your system further by changing the "stride" and "stripe-width" parameters.

You'll need to know some things about your raid volume like raid level, number of disks, raid chunk size, and filesystem block size, but they are not hard to find. The BIOS in your raid controller will tell you these things if you do not know how to get your operating system to tell you this.

Check out this handy calculator that will determine the stride and stripe-width for you: http://busybox.net/~aldot/mkfs_stride.html

If your filesystem already exists, simply use tune2fs, instead of mkfs, in the following mannor:

tune2fs -E stride={xx},stripe-width={xx}

I doubt you can safely do this on a mounted volume so boot from a live cd if you cannot first unmount the volume in question.
archangel689
Posts: 7
Joined: Mon Nov 30, 2009 4:50 am

Post by archangel689 »

I'm confused as to why you're using ext3 at all . If I'm dealing with large files, especially video I'd look into XFS since that is specifically what it was made for. JFS is also an option.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Post by knight-of-ni »

Out of the box, zoneminder doesn't create large files. It creates a lot of small jpeg's, but I agree with your point that perhaps a different file-system would be something to consider.

I've used reiserfs on a past system, but I never tested to see if that system benefited from it. The system I'm running now (CentOS) doesn't have reiserfs support in the standard kernel, and due to suboptimal results with the CentOS Plus kernel, I have chosen to stick with the ext3 file-system for the time being as my attention is currently diverted elsewhere.

If you can make a convincing argument for a particular file-system, I would be willing to consider it.
Post Reply