Zoneminder with Firefox in localhost = CPU overload
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
Zoneminder with Firefox in localhost = CPU overload
Hi all,
Sorry for a lot of time away
i have a question, since the begin, ive saw that Zoneminder With Firefox running on the same machine cause some cpu usage, if you are using in record mode, this cpu usage is not so high, but using modect you get a bom in hand.
Im running 16 cams, 3fps each, bttv card based
Pentium 4 ht 3.0 Ghz
1 GB Memory DDR
120 GB hard disk
I can run 16 cameras with firefox showing montage if all cameras set as Record mode. 40-60 % CPU Idle
Setting all in modect mode with firefox in montage, i get 0% CPU idle.
This is NOT a bug, i know, it can be a bad issue, but since from beginning this occurs, so i cannot define it as a bug.
But i would like to know why it takes so much from CPU, this makes my firefox´s montage freeze from times to times when tere are a lot of motion in cameras.
Firefox freezes for 3-5 seconds, then returns when motion has passed. after that, when a new huge motion is seen in many cameras, firefox again freezes, (it freezes because CPU idle goes to 0%) and after motion stops, it back from freeze and show correctly montage.
Im sure there should be a way to make zoneminder use less cpu to detect if there is motion or not.
Also, if i run 16 cams in Modect but WITHOUT montage, all goes well and CPU consumption gets 10-20% idle.
I had succes building a zm box for 4/8 cams, but if i dont solve this, its probabily a 16 cams version cannot become true. The box need to have firefox showing montage because the system have a TV Output, and its used to substitute a multiplexer, connecting it directly to the DVR.
So, i want to know how to make zm to use less cpu in modect mode or use something different from mozilla to show montage on screen.
Thanks all for reading all this
Victor Diago
Sorry for a lot of time away
i have a question, since the begin, ive saw that Zoneminder With Firefox running on the same machine cause some cpu usage, if you are using in record mode, this cpu usage is not so high, but using modect you get a bom in hand.
Im running 16 cams, 3fps each, bttv card based
Pentium 4 ht 3.0 Ghz
1 GB Memory DDR
120 GB hard disk
I can run 16 cameras with firefox showing montage if all cameras set as Record mode. 40-60 % CPU Idle
Setting all in modect mode with firefox in montage, i get 0% CPU idle.
This is NOT a bug, i know, it can be a bad issue, but since from beginning this occurs, so i cannot define it as a bug.
But i would like to know why it takes so much from CPU, this makes my firefox´s montage freeze from times to times when tere are a lot of motion in cameras.
Firefox freezes for 3-5 seconds, then returns when motion has passed. after that, when a new huge motion is seen in many cameras, firefox again freezes, (it freezes because CPU idle goes to 0%) and after motion stops, it back from freeze and show correctly montage.
Im sure there should be a way to make zoneminder use less cpu to detect if there is motion or not.
Also, if i run 16 cams in Modect but WITHOUT montage, all goes well and CPU consumption gets 10-20% idle.
I had succes building a zm box for 4/8 cams, but if i dont solve this, its probabily a 16 cams version cannot become true. The box need to have firefox showing montage because the system have a TV Output, and its used to substitute a multiplexer, connecting it directly to the DVR.
So, i want to know how to make zm to use less cpu in modect mode or use something different from mozilla to show montage on screen.
Thanks all for reading all this
Victor Diago
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
From what has been discussed on here many times the most efficient way to show live footage on local machine to to grab video from shared mem. But none of us have the ability to write such an app. There was a forum member who said he was going to give it a go recently but due to the size of the task im persoanlly not hoping too hard. I tried to use xawtv/tvtime just to show live images and this is possible, but only possible if using one chip per input. Multiplexed inputs cannot be shared like in zm. The best way i have come up with so far is to connect a quad/multiplexer to a spare input and set this to monitor only and use this for live display. Not ideal but ok. The other option is to have a second low spec machine just for displaying montage.
James
PS is it best to have HT on, on a p4 I always thought it was best to turn it off.
James
PS is it best to have HT on, on a p4 I always thought it was best to turn it off.
There are two things you have to look at here.
1) ZMS is started and using resources.
2)Firefox is using resorces
It's been my experiance that while zms uses some resources it's not the one that creates the issue but firefox you will notice consumes more memory the more streams it receives and the longer the browser is left open you will find that it will start using the swap partition. I have posted this question of what might cause firefox to act like this and have never recived a responce. Now running 16 cameras like this would be a big problem and until you find and resolve why firefox keeps growing in size and resolve it there is not much that can be done.
I have today turned off all caching in firefox to see if this might help firefox behave a bit more. It is to early yet to post any results. The only other thing I can think of is to decrease network-keepalive or turn it off. But for testing I will only do one thing at a time and keep notes to see if there is a combination that performs better or not at all.
Regards,
Cordel
1) ZMS is started and using resources.
2)Firefox is using resorces
It's been my experiance that while zms uses some resources it's not the one that creates the issue but firefox you will notice consumes more memory the more streams it receives and the longer the browser is left open you will find that it will start using the swap partition. I have posted this question of what might cause firefox to act like this and have never recived a responce. Now running 16 cameras like this would be a big problem and until you find and resolve why firefox keeps growing in size and resolve it there is not much that can be done.
I have today turned off all caching in firefox to see if this might help firefox behave a bit more. It is to early yet to post any results. The only other thing I can think of is to decrease network-keepalive or turn it off. But for testing I will only do one thing at a time and keep notes to see if there is a combination that performs better or not at all.
Regards,
Cordel
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
Hi all and thanks for the answers.
Here i go,
i have made a lot of tests in firefox, surelly disabling the caching issues INCLUDING :
browser.cache.disk.enable
browser.cache.memory.enable
network.http.use-cache
Disabling all these three really make some huge difference about memory consumption, but i have never disabled network.http.keep-alive.timeout why should it make some difference ?
Actually i can successfully run a box with 4 or 8 cameras + Firefox.
Machine i use for 8 cameras :
Sempron 2.8 / Celeron 2.4
512 MB ram
256 MB shared memory
Those firefox configurations above.
Also, to make sure system is stable aways, i perform a reboot on mondays , thurdays and fridays at 5:10 am, in the reboot the zm box runs myisamchk -rf in all zm/*.MYI mysql tables.
This above runs very nice.
Another thing ive read here is that changing the Zones from Blob way to AlarmedPixels way should help, as the cpu goes crazy in modect mode but not in record mode. Sure record mode loads cpu too, but much less than modect, im trying the AlarmedPixels configuration now... i expect this to work because was philip that said that.
I will search more about this, i have some knowledge in c/c++ so, if we really want to have this, i will help to build it.
Thanks again for your all
Victor Diago
Here i go,
i have made a lot of tests in firefox, surelly disabling the caching issues INCLUDING :
browser.cache.disk.enable
browser.cache.memory.enable
network.http.use-cache
Disabling all these three really make some huge difference about memory consumption, but i have never disabled network.http.keep-alive.timeout why should it make some difference ?
Actually i can successfully run a box with 4 or 8 cameras + Firefox.
Machine i use for 8 cameras :
Sempron 2.8 / Celeron 2.4
512 MB ram
256 MB shared memory
Those firefox configurations above.
Also, to make sure system is stable aways, i perform a reboot on mondays , thurdays and fridays at 5:10 am, in the reboot the zm box runs myisamchk -rf in all zm/*.MYI mysql tables.
This above runs very nice.
Another thing ive read here is that changing the Zones from Blob way to AlarmedPixels way should help, as the cpu goes crazy in modect mode but not in record mode. Sure record mode loads cpu too, but much less than modect, im trying the AlarmedPixels configuration now... i expect this to work because was philip that said that.
I will search more about this, i have some knowledge in c/c++ so, if we really want to have this, i will help to build it.
Thanks again for your all
Victor Diago
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
eLViS
http://www.silicontao.com/software/lvs/ ... ation.html
Might not need that much alteration. Does this do the magic 'grabbing of images from shared mem'?
James
http://www.silicontao.com/software/lvs/ ... ation.html
Might not need that much alteration. Does this do the magic 'grabbing of images from shared mem'?
James
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
im surelly interested.
i have bought a little modification of zoneminder and added some abilities.
First is a wat to connect webcdwriter and zoneminder.
when you click in a "Burn CD" link on console page, a php script searches all archived events and make symlinks to them in /burn directory. then, after it loads webcdwriter and webcdwriter export the /burn directory... this is aa easy and effective way to deal with cd burning software in zoneminder.
Now i will start something different, it will be a VCD burner, to burn selected events in VCD format with interactive menu, that give details for each event. but i really need to first solve this problem.
Could you post here the link of EiLVS ?
thanks for now
Victor Diago
i have bought a little modification of zoneminder and added some abilities.
First is a wat to connect webcdwriter and zoneminder.
when you click in a "Burn CD" link on console page, a php script searches all archived events and make symlinks to them in /burn directory. then, after it loads webcdwriter and webcdwriter export the /burn directory... this is aa easy and effective way to deal with cd burning software in zoneminder.
Now i will start something different, it will be a VCD burner, to burn selected events in VCD format with interactive menu, that give details for each event. but i really need to first solve this problem.
Could you post here the link of EiLVS ?
thanks for now
Victor Diago
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
And to answer your question James, I don't think the program is set up to pull from shared memory by it's discription although it may. I can make the GUI but don't know enough to get the bits in there to do the real work. Although eLViS might give enough insight to see what could be done.
Regards,
Cordel
Regards,
Cordel
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
well its a good 5 mile above my head. Now then i have a question
ZM takes images from whatever source and puts them into shared memory for the deamons etc to analyse these images. Then i suppose the streaming deamon accesses shared mem to show these images. Once the images are written to disk or the buffer is full new images replace them.
What it would appear we need is a way of showing these images straight out of shared mem into x?
And out of all the open wierd and wonderful open source projects that exist, nothing that can do this does?
James
ZM takes images from whatever source and puts them into shared memory for the deamons etc to analyse these images. Then i suppose the streaming deamon accesses shared mem to show these images. Once the images are written to disk or the buffer is full new images replace them.
What it would appear we need is a way of showing these images straight out of shared mem into x?
And out of all the open wierd and wonderful open source projects that exist, nothing that can do this does?
James
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK