Serious Slowdown

Support and queries relating to all previous versions of ZoneMinder
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

phil i have had another ides
can i create a directory maybe /var/www/hetl/live/
and in here have jpgs created and over written called <monitornumber>.jpg
It seems i can pull jpgs through apache much fater and at lower load than zms. I understand why this is, but wondered if there would be an issue with pulling images of a file that was about to be overwritten etc etc. Would this work if so how do i get zm to make the images
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

is the above possible?

And obviosly gonna try mmx. FYI i have incresed the jpg compression on streamed images (from 90 to 80) and the load has dropped, does this point towrds jpg encoding/decoding issues or netword. ALso i have (with brainbox corey's help) got phpsysinfo on it. It the network counters get to 4gig then error and start again
Canonical Hostname localhost
Listening IP 10.129.5.211
Kernel Version 2.6.12-oci4.mdk-i686-up-4GB
Distro Name pclinuxos Linux release 2005 (Texstar) for i586
Uptime 3 days 9 hours 0 minutes
Current Users 0
Load Averages 8.17 6.23 5.99



Network Usage
Device Received Sent Err/Drop
lo 11.43 KB 11.43 KB 0/0
eth0 355.37 MB 308.82 MB 5/11

James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Pulling a constant file is possible but needs to be implemented so that ZM isn't writing to the file as your app is reading it. So ZM would have to write to a temporary and then rename it it or something along those lines. It would probably increase the load on the ZM box if ZM had to start writing jpegs that it otherwise wouldn't bother with though.

Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

the reason i ask is that i ahve had issues with zms taking the same monitor twice +. If i have say a 500ms refresh rate and have 8 cams, make the 9th a copy of mon 3 mon3 on both seems to stall, im thinking of making zm4ms only take to 8 streams(if you can call them streams i dunno) and make a 9th itself to help load on the server. What i dont understand is if i disable the ip cams this thing move ie 16 cams and a load of maybe 0.8 - 1.2 whislt using zm4ms too. As soon as i enable the ip cams it virtually dies. Could it be a lib problem or is 5 a max for ip cams on zm?
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

There is no fixed maximum but perhaps it's tipping over an edge. However 5 doesn't seem very many. I was looking at a site over the weekend with 13 or so which was running at a very small load.

Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

ok i must having something wrong somewhere, they are 640x480 though, and in mocord mode but record makes barely any difference though. I started wondering at first if i had a prob witht he raid as it seemed to only write 1 meg a second, but victor asked me to do a hdparm thingy and it shifted 90meg a second write over 4 seconds so i think the array is fine.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

i think this is a jpeg issue as i have set a new monitor of an existing and it nails the machine, and 100% the proc. So it appears the limit is reached with jpeg's when its out of processer power, as the jpeg take so long to process the whole thing starts to queue, it also appears in top that the jpegs cause the system % to increase not the user. I assume this is because the jpegs are processed by the 'system' not zms or zma/c
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

right then after extensive research i have decieded that using zm4ms and very low compression on the axis's is the problem. I am gonna do a site visit and increase the compression of the jpg's from the cams as im assuming smaller file sizes will be easier for zm to deal with. This (again im assuming) will also lower the file sizes for zms and im hoping lower the load.
Also i think you are right now, the work required to get zm4ms to do raw images will be worth it. I havnt got a clue how im gonna deal with raw images but im assuming somone has done it before with .net so i should be able to too, (google is my best mate).

Im assuming it will be another tpe for zms to handle and i will just alter the path statement to get a differnt type of image, and then deal with it somehow?

James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Yes, it will just send the raw image data, so the data transfer size will be higher, but there will be no CPU expended in compressing the images before sending and none at your end decompressing. ou should be able to map them directly to your screen buffer.

Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

update,
it appears some cretin (me) enabled hyperthreading on a non smp kernel

loads were huge as previoyus posts upto 20
chnaged the fps of the ip cams to 1 fps and this helped but not massivly (was still on loads of 5-8)

rebooted turned off hyperthreading (and made a modest overclock now running at 3.4 Gig)
loads now 1-2
will up the fps in the next sday or 2 once i know its stable and report back.

James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Good. Hopefully that will be a permanent fix but let us know. You are doing a ton more testing of this kind of thing that I ever do here :)

Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

well i upped the fps back up to 2 per ip cam enabeled another 4 ip cams taking the total tally to
16 med res bttv cams
7 640x480 axis 206 at 2 fps
load is now around the 2-3 mark with 2 users perm connected via zm4ms (these users load all 24 cams up and leave them there day and bloody night.)!!
processor now sits at arounf 40% user 7-9% system 0-1% io wait and 50% idle
before i was lucky to have 1% idle (poxy HT technology)!!

I will let you know what happens when the disks fill up gain as they are currently at about 52%
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

well bad news its back.
It runs great for about a week i checked in yesterday and the load was upto 12.
So it wasnt ht
I obviously have something that consumes everything but as i cant get top to run remotly then i cant see what it is
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

i think thi smaybe related to the number of events stored as it was ok when the drive was below 70% bow its slow again. Is this likely (1.21.3)
I have been waiting now for 15 mins for the console to open. from memory though it has in the region of 70000 events stored (24 cams set to modect on 15 min evnt time.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

It may well be related to events I guess. As a disk fills up it may take longer to locate free space for new files and longer for the database to rewrite table files etc.

You mentioned that you have cameras set to Modect with 15 minute times, did you mean Modect or Mocord as if you are consistently getting Modect events longer than 15 minutes it may be that just going to an unconditional recording mode might be better.

You have mentioned before about not being able to run top via webmin. Do you not get the same information anyway from System->Running Processes->CPU in webmin?

Phil
Locked