CPU sits at 60% with small image and 5 FPS

Support and queries relating to all previous versions of ZoneMinder
Locked
bikerfreak
Posts: 10
Joined: Mon Nov 15, 2004 7:24 pm

CPU sits at 60% with small image and 5 FPS

Post by bikerfreak »

Hi, I know this topic has probably been beaten to death, but I my CPU usage is abnormally higher than what most users on this forum are reporting. Below is the result of my top and as you can see, zma takes up a good deal of CPU.

Most people on this forum reports zma going up when there's an event and runs low when it's idle, but mine sits at 30-40% when there's no event at all. I also varied the Max FPS from 5-30 and it makes no difference. The values below are from a Max FPS of 5. zmc and zma take up most of the CPU with mysqld occassionally jumping in there at 99.9% CPU load and lasting about 1-2 seconds.

I'm not seeing the memory leak in Apache as others have reported so I don't think that's the issue. Memory usage stays pretty much consistent. swap space is not even been used so I know everything is sitting in RAM. And I'm taking really small photos (320x240) at 5 FPS.

My server setup is as follows:
1.3Ghz C3
256MB RAM DDR
160GB HD
RedHat 8
RGB24 input
BT878A 4 channel capture card. Only 1 channel is in Modect, the other 3 are currently set to none (not capturing).

At this CPU %, I don't see how I can even get 2 out of 4 channels running on this box.

Anyone else experiencing a similar problem? Anything else I can try?

Code: Select all

  3:28pm  up  7:05,  3 users,  load average: 1.45, 1.13, 0.93
70 processes: 67 sleeping, 3 running, 0 zombie, 0 stopped
CPU states: 74.3% user,  2.1% system,  0.0% nice, 23.4% idle
Mem:   255656K av,  229492K used,   26164K free,       0K shrd,   31100K buff
Swap: 1052248K av,       0K used, 1052248K free                  129780K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
16549 apache    24   0 24552  23M 23600 S    37.2  9.6  43:18 /usr/local/bin/zma -m 1
13823 apache    15   0 28740  24M 23600 R    23.8  9.6  34:31 /usr/local/bin/zmc -d 0
13148 root      15   0  5940 5940  5520 S     1.7  2.3   2:53 /usr/sbin/httpd
23414 root      15   0  1060 1060   820 R     0.7  0.4   0:00 top -c
   11 root      15   0     0    0     0 SW    0.1  0.0   0:01 kjournald
 1693 mysql     15   0  7028 7028  2620 S     0.1  2.7   0:10 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=
    1 root      15   0   460  460   408 S     0.0  0.1   0:04 init
    2 root      15   0     0    0     0 SW    0.0  0.0   0:00 keventd
    3 root      34  19     0    0     0 SWN   0.0  0.0   0:00 ksoftirqd_CPU0
    4 root      15   0     0    0     0 SW    0.0  0.0   0:00 kswapd
    5 root      25   0     0    0     0 SW    0.0  0.0   0:00 bdflush
    6 root      15   0     0    0     0 SW    0.0  0.0   0:00 kupdated
    7 root      25   0     0    0     0 SW    0.0  0.0   0:00 mdrecoveryd
   67 root      15   0     0    0     0 SW    0.0  0.0   0:00 khubd
  225 root      15   0     0    0     0 SW    0.0  0.0   0:00 kjournald
  503 root      16   0   536  536   448 S     0.0  0.2   0:00 syslogd -m 0
  507 root      15   0   432  432   376 S     0.0  0.1   0:00 klogd -x
  524 rpc       15   0   528  528   452 S     0.0  0.2   0:00 portmap
  543 rpcuser   18   0   728  728   636 S     0.0  0.2   0:00 rpc.statd
  655 root      20   0  1428 1428  1276 S     0.0  0.5   0:07 /usr/sbin/sshd
  669 root      15   0   924  924   788 S     0.0  0.3   0:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
  730 root      15   0  2244 2244  1660 S     0.0  0.8   0:00 sendmail: accepting connections
  742 smmsp     15   0  2004 2000  1536 S     0.0  0.7   0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
  753 root      15   0   428  428   376 S     0.0  0.1   0:00 gpm -t imps2 -m /dev/mouse
  773 root      15   0   616  616   540 S     0.0  0.2   0:00 crond
  804 xfs       15   0  3260 3260   880 S     0.0  1.2   0:00 xfs -droppriv -daemon
  822 daemon    15   0   524  524   464 S     0.0  0.2   0:00 /usr/sbin/atd
  832 root      16   0   388  388   336 S     0.0  0.1   0:00 /sbin/mingetty tty2
  833 root      16   0   388  388   336 S     0.0  0.1   0:00 /sbin/mingetty tty3
  834 root      16   0   388  388   336 S     0.0  0.1   0:00 /sbin/mingetty tty4
  835 root      16   0   388  388   336 S     0.0  0.1   0:00 /sbin/mingetty tty5
  836 root      16   0   388  388   336 S     0.0  0.1   0:00 /sbin/mingetty tty6
  895 root      16   0   388  388   336 S     0.0  0.1   0:00 /sbin/mingetty tty1
 1206 root      15   0  1476 1476  1128 S     0.0  0.5   0:00 -bash
 1666 root      19   0  1172 1172  1008 S     0.0  0.4   0:00 /bin/sh /usr/bin/safe_mysqld --defaults-file=/etc/my.cnf
 3397 root      15   0  1480 1480  1128 S     0.0  0.5   0:00 -bash
10106 root      15   0  1468 1468  1128 S     0.0  0.5   0:00 -bash
13201 apache    15   0  5240 5240  1984 S     0.0  2.0   0:01 /usr/bin/perl -wT /usr/local/bin/zmdc.pl status
13226 apache    15   0 11340  11M  2056 S     0.0  4.4   0:01 /usr/bin/perl -wT /usr/local/bin/zmfilter.pl
13231 apache    15   0  4156 4156  1824 S     0.0  1.6   0:00 /usr/bin/perl -wT /usr/local/bin/zmaudit.pl -d 900 -y
13238 apache    15   0  4656 4656  1896 S     0.0  1.8   0:00 /usr/bin/perl -wT /usr/local/bin/zmwatch.pl
13243 apache    15   0  5800 5800  1904 S     0.0  2.2   0:00 /usr/bin/perl -w /usr/local/bin/zmupdate.pl -c
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Hi bikerfreak,
zma is the analisis of the images for changes in pixels. The higher the frame rate the harder this will have to work.

You might want to try skipping a frame by setting Frame Skip to 1 this might reduce the load of zma or bring down the FPS for the cam. I run mine at 2 fps and skip one frame.
I'm running a Atholon XP2000, with FC2, 512M ram, with four cameras and three of them set for modetect. here is my top,

2771 apache 15 0 127m 41m 44m S 1.0 9.4 0:53.47 zmc
2781 apache 15 0 98608 10m 13m S 1.0 2.4 1:03.57 zma
2775 apache 15 0 99400 10m 13m S 0.7 2.4 1:08.48 zma
2787 apache 15 0 98840 10m 13m S 0.7 2.4 0:51.55 zma

My cameras are all B/W and not color so this will make a differance as well.

"Most people on this forum reports zma going up when there's an event and runs low when it's idle,"
M_NO_MAX_FPS_ON_ALARM Should any Maximum FPS be ignored if an alarm occurs (?) if you have this checked, when an alarm occures it will capture as fast as it can handle and the load will also go up until the alarm clears.

I haven't used zm with RH8, only 9, ferdora 1, and fedora 2 so their could be some other issues that I don't know about (but that is always a constant LOL).
Hope this helps give you some insight at least.
Cordel
Locked