ZM 1.22.3 using all memory and swap

Support and queries relating to all previous versions of ZoneMinder
Hack
Posts: 2
Joined: Mon Feb 26, 2007 7:43 pm

ZM 1.22.3 using all memory and swap

Post by Hack »

I used a livecd (xubuntu) to setup a Zm system with a bt878 4 port card. The box has a p4 3.0 800fsb and 2gb ram and 1gb swap. When I leave two cameras running in a browser window for a couple days some process then kicks in and simply overwhelms the box. It uses all 3 gb's of ram and swap and the box come to a crawl. I don't record or motion check the output for recording, I just want it to view what the cameras are outputing. I searched the forums under memory and swap and there are tons of them, but most are for machines that are not as hefty as this one is. is there something I need to turn off? I would think that I should be able to view at 40fps as long as I'm not recording. Please any ideas are most welcomed.

Wayne
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

You need to change the option to stop using nph-zms in options.

Change nph-zms to zms in options/paths:

ZM_PATH_ZMS = /cgi-bin/zms

As far as I know, this is a problem with apache2 and this change works much better for me. I still see some memory leaking, but not nearly as much on my system.
MRD
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Check to see what process is consuming the resources, I be will ing to bet it the browser. You will have to configure the bowser so that it don't cache.
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

On my Xubuntu system nph-zms was consuming the most and after making the change I described, it seems to be a huge improvement. Prior to the change I would run the system for about 24 hours and then it would slow to a crawl until I rebooted.

I've read that there is a bug in Apache2 that causes the memory leak. Is this no longer the case?
MRD
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

The bug with apache is a few years old and was resolved by the apache team.
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

Ok...

With ZM_PATH_ZMS = /cgi-bin/nph-zms my Xubuntu system will just about die after a few days of running without having a browser open for any length of time. There ends up being several/duplicate nph-zms processes running and I end up rebooting to resolve the memory and process issues. If I set ZM_PATH_ZMS = /cgi-bin/zms then everything works much better and there is far less memory usage.

Any ideas?
MRD
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

There is no difference between the to binaries other than the name. Any cgi run by apache that starts with nph (Which stands for "No Parse Headers) forces apache to not parse the headers.
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

OK.

So then if there is no difference except for the way apache handles this with it set to use nph and there are significant memory leaks... is this not a problem with apache?
MRD
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Since I don't know your system, or how you have it configured, I really couldn't say. I do know out of thousands of users not many report this issue with current versions of apache. I know that I have no issues with either binary. If your having these issues, I might split this thread since we have now runaway with this guys thread which is some what rude.
Hack
Posts: 2
Joined: Mon Feb 26, 2007 7:43 pm

Update ZM using all memory resources

Post by Hack »

First off, I want to apologize for appearing rude. That was definetly not my intent at all.

I did a test where I let the system idle for two days without the zm browser window open. I checked the memory usage over that time and it is not being used by any other programs. Even the nightly cron jobs don't have any effect on the system of the 2gb of physical ram it used at max 524m. So that leaves it back to the zm processes I think. I will try that path change and report back in a day or two. Thanks for the idea to try.

Wayne
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

@Hack
I was not refering to you being rude, but mrd and myself for running away with your thread :lol:
CoolRide
Posts: 3
Joined: Thu Mar 08, 2007 2:16 pm

Post by CoolRide »

I can confirm that if you use nph-zms, Apache2 will eat all your memory and Cpu even Cpu's if you have a dual core.

To solve that I have set the ZM_PATH_ZMS = /cgi-bin/zms in the startscript.
since that moment I never saw the problem again.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Okay so to help get to the bottom of this:
Distro/Release?
Apache Version?
babba
Posts: 9
Joined: Wed Mar 07, 2007 2:47 pm

Post by babba »

Folks,

I am a 'bloody' ZonMinder beginner and just had not the guts to report exacly the same problem described above.

Due to very limited Linux experiance I was somehow assuming I am the problem :oops:

Glad to see that others do see the same.

I'll try the hint and set nph-zms to zms in options/paths:

ZM_PATH_ZMS = /cgi-bin/zms

Thanks for this great piece of SW and Thanks for all the good support.

Greetings Dieter
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Great, four reports
cordel wrote:Okay so to help get to the bottom of this:
Distro/Release?
Apache Version?
PHP version should be on that list as well.
Whether you used a package or built from source would be good to know as well.

But without knowing your setup, it's some what hard for us to replicate and work to find a fix.

Help Us to be able to help you Please, otherwise are hands are tied and no one will bother looking for it and I might as well just round file this post.
http://www.zoneminder.com/forums/viewtopic.php?t=6427
Locked