Boost ZoneMinder performance – Debian

I’ve been struggling with the performance on a ZoneMinder based CCTV virtual machine for the last couple of weeks. I’ve been receiving alerts for CPU useage for this from the vCenter server, and today, I’ve finally made some progress thanks to some hunting of the ZoneMinder forums.

I found this article:

Which suggests that changing the libjpeg libraries with those in the forum, allow the library to use the MMX features of the CPU and thus process the mjpeg video’s more efficiently.

To sum it up, the load values on this VM (running Debian Squeeze) were at roughly 7.53, 6.78 and 6.65, with the CPU at 0.00%id. After running the commands below, the CPU idle time is averaging at roughly 20%, and the load after an hour or so is now at 2.46, 2.23 and 2.35, so a very effective improvement.

Here’s the bash commands I ran to get the replacement jpeg library installed:

mkdir /usr/src/libjpeg-simd
cd /usr/src/libjpeg-simd
tar xzvf jpegsrc-6b-x86simd-1.02.tar.gz
apt-get update
apt-get install build-essential
apt-get install nasm
cd j*
./configure --enable-shared
/etc/init.d/zoneminder stop
make install
/etc/init.d/zoneminder start