How to use ramdisk?

Forum for questions and support relating to the 1.24.x releases only.
Locked
steffan
Posts: 11
Joined: Sun Apr 17, 2011 6:50 pm

How to use ramdisk?

Post by steffan »

Hey Guys,


Iv'e noticed that my zoneminder installation is using a lot of the disk's speed since im going for high FPS,
The way i have understand that zoneminder works is by taking a picture from the camera, then takes another picture and then compares them, if there's any change, then start recording. if not, it deletes the pictures that it used for checking after the specified number of "Buffer pictures" .. right ??? or am i wrong?

Anyways, my idear was to use a RAMdisk for all those temperary pictures that zoneminder uses for checking, but where can i specify do use another folder for this ? looks like it default uses the "events" folder, where it also saves the recordet alarms.

is this possible? i think it will help alot on my performance, which would be great since zoneminder is not the only server running on those disks in my setup :P

-Steffan
pathetic_programmer
Posts: 18
Joined: Fri Dec 09, 2011 2:49 am

Re: How to use ramdisk?

Post by pathetic_programmer »

If I'm not mistaken, Zoneminder keeps everything in RAM until it needs to write it to disk. That is probably the reason why you have to increase the amount of shared RAM available in the kernel when you have a large amount of cameras or high frame rate systems. What's probably happening is that you either don't have enough RAM in your system, or your getting a large amount of alerts that have to be written.

If you don't have enough RAM to handle all of your high frame rate cameras, then your computer may be automatically start swapping out data to your hard drive to have room for other things to be processed. In order to help alleviate this, you could lower the buffers or add more RAM to your system.

http://www.zoneminder.com/forums/viewto ... =9&t=17652
Mastertheknife seems to have created a patch to improve Zoneminders performance, it might be worth looking into. I haven't used it, so I can't say how good it works.
steffan wrote:is this possible? i think it will help alot on my performance, which would be great since zoneminder is not the only server running on those disks in my setup :P
That right there might be your problem too. I'm not saying that Zoneminder isn't friendly with other programs, but they may be what is causing all the traffic to the disks.

Try this, in a command line, type in:

Code: Select all

free -m
This will show you how much of your Swap space, (Virtual RAM) is in use. If it is full then your system may not have enough RAM to handle Zoneminder and the other programs running on that system.
steffan
Posts: 11
Joined: Sun Apr 17, 2011 6:50 pm

Re: How to use ramdisk?

Post by steffan »

pathetic_programmer wrote:If I'm not mistaken, Zoneminder keeps everything in RAM until it needs to write it to disk. That is probably the reason why you have to increase the amount of shared RAM available in the kernel when you have a large amount of cameras or high frame rate systems. What's probably happening is that you either don't have enough RAM in your system, or your getting a large amount of alerts that have to be written.
Sound good thats it's the default settings, but can i verify somehow that it actually does use the RAM for the temp files?
pathenic_programmer wrote:If you don't have enough RAM to handle all of your high frame rate cameras, then your computer may be automatically start swapping out data to your hard drive to have room for other things to be processed. In order to help alleviate this, you could lower the buffers or add more RAM to your system.
The machine has 1 gig of ram, and its running ubuntu server 11.04 (which takes only about 2-300 MB RAM on its own, so the rest is for zoneminder only.
pathenic_programmer wrote:http://www.zoneminder.com/forums/viewto ... =9&t=17652
Mastertheknife seems to have created a patch to improve Zoneminders performance, it might be worth looking into. I haven't used it, so I can't say how good it works.
I will take a look into that, sound great!!
pathenic_programmer wrote:
steffan wrote:is this possible? i think it will help alot on my performance, which would be great since zoneminder is not the only server running on those disks in my setup :P
That right there might be your problem too. I'm not saying that Zoneminder isn't friendly with other programs, but they may be what is causing all the traffic to the disks.
Oh, i think you misunderstod me..
Quick overview of my setup:

I run my zoneminder server in a VMware ESX server, as a virtual machine, this ESX server runs miltiple virtual machines, both windows and linux, all those virtual machines run off the same NFS storage which is a RAID5 disk array. performance on these disk's are great, right now im running 7 virtual server, and i can still write to the disk's with 10 MB/s without them overloading at all.

But as soon as i start my zoneminder server (which only runs zoneminder on that OS, and no other application/services) the disk array get overloadet easely, so zoneminder must take a LOT of the disk's speed.

I have disabled all camera's in my zoneminder setup, so i only have 1 active, that one is an AXIS with 640x480, with an ALARM FPS of 30, and a "standby" (when there are no alarms) FPS of 10. and set so if an alarm accours, 40 frames before the alarm will get saved too.

(feel free to ask for screenshots or whatever you need of my zoneminder settings!)
pathenic_programmer wrote: Try this, in a command line, type in:

Code: Select all

free -m
This will show you how much of your Swap space, (Virtual RAM) is in use. If it is full then your system may not have enough RAM to handle Zoneminder and the other programs running on that system.
here's the output:

Code: Select all

zm@zm:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1001        389        611          0         25        227
-/+ buffers/cache:        135        865
Swap:         1101          0       1101
In my eyes, thats looks good. no swap used, over 600 megs of free physical RAM


And thanks for your answer, im really lost on this one, i somehow think i just made some settings wrong..
pathetic_programmer
Posts: 18
Joined: Fri Dec 09, 2011 2:49 am

Re: How to use ramdisk?

Post by pathetic_programmer »

steffan wrote:Sound good thats it's the default settings, but can i verify somehow that it actually does use the RAM for the temp files?
Not that I know of, but I'm still quite new to Zoneminder, so don't be discouraged.
steffan wrote:The machine has 1 gig of ram, and its running ubuntu server 11.04 (which takes only about 2-300 MB RAM on its own, so the rest is for zoneminder only.

I will take a look into that, sound great!!

Oh, i think you misunderstod me..
Quick overview of my setup:

I run my zoneminder server in a VMware ESX server, as a virtual machine, this ESX server runs miltiple virtual machines, both windows and linux, all those virtual machines run off the same NFS storage which is a RAID5 disk array. performance on these disk's are great, right now im running 7 virtual server, and i can still write to the disk's with 10 MB/s without them overloading at all.
Is that for one really big file or several small ones? That's a possibility there, most systems can run full speed with really large files, but when they start doing several small images, such as the frames from a security camera, it can bog the system down since it has to start and stop constantly when writing the files.
steffan wrote:But as soon as i start my zoneminder server (which only runs zoneminder on that OS, and no other application/services) the disk array get overloadet easely, so zoneminder must take a LOT of the disk's speed.

I have disabled all camera's in my zoneminder setup, so i only have 1 active, that one is an AXIS with 640x480, with an ALARM FPS of 30, and a "standby" (when there are no alarms) FPS of 10. and set so if an alarm accours, 40 frames before the alarm will get saved too.

(feel free to ask for screenshots or whatever you need of my zoneminder settings!)
If you disable all of the cameras and it is still using up the hard drive like crazy, I'd say your install of Zoneminder may be messed up. I'd try reinstalling it myself.
steffan wrote:here's the output:

Code: Select all

zm@zm:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1001        389        611          0         25        227
-/+ buffers/cache:        135        865
Swap:         1101          0       1101
In my eyes, thats looks good. no swap used, over 600 megs of free physical RAM
Looks good to me as well.
steffan
Posts: 11
Joined: Sun Apr 17, 2011 6:50 pm

Re: How to use ramdisk?

Post by steffan »

pathetic_programmer wrote:
steffan wrote:Sound good thats it's the default settings, but can i verify somehow that it actually does use the RAM for the temp files?
Not that I know of, but I'm still quite new to Zoneminder, so don't be discouraged.
steffan wrote:The machine has 1 gig of ram, and its running ubuntu server 11.04 (which takes only about 2-300 MB RAM on its own, so the rest is for zoneminder only.

I will take a look into that, sound great!!

Oh, i think you misunderstod me..
Quick overview of my setup:

I run my zoneminder server in a VMware ESX server, as a virtual machine, this ESX server runs miltiple virtual machines, both windows and linux, all those virtual machines run off the same NFS storage which is a RAID5 disk array. performance on these disk's are great, right now im running 7 virtual server, and i can still write to the disk's with 10 MB/s without them overloading at all.
Is that for one really big file or several small ones? That's a possibility there, most systems can run full speed with really large files, but when they start doing several small images, such as the frames from a security camera, it can bog the system down since it has to start and stop constantly when writing the files.
steffan wrote:But as soon as i start my zoneminder server (which only runs zoneminder on that OS, and no other application/services) the disk array get overloadet easely, so zoneminder must take a LOT of the disk's speed.

I have disabled all camera's in my zoneminder setup, so i only have 1 active, that one is an AXIS with 640x480, with an ALARM FPS of 30, and a "standby" (when there are no alarms) FPS of 10. and set so if an alarm accours, 40 frames before the alarm will get saved too.

(feel free to ask for screenshots or whatever you need of my zoneminder settings!)
If you disable all of the cameras and it is still using up the hard drive like crazy, I'd say your install of Zoneminder may be messed up. I'd try reinstalling it myself.
steffan wrote:here's the output:

Code: Select all

zm@zm:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1001        389        611          0         25        227
-/+ buffers/cache:        135        865
Swap:         1101          0       1101
In my eyes, thats looks good. no swap used, over 600 megs of free physical RAM
Looks good to me as well.
I last testet with a big file (downloading a iso in a torrent, a legal one of course!) which keept jamming the disk's cashe to 100% overload when only downloading at 1 MB/S while zoneminder was running on another server but on the same disk's. stoppet zoneminder, at torrent could easely download with 8 MB/S without the disk's cache filling up..

I think your right that my zoneminder i messed up somehow, even tho i have looked trough all the settings and cant find something that looks wrong, but i will try to make a new server (only because its easy as hell, a right click in the ESX server and install ubuntu from iso, ~20 min and im done ;D)
Locked