Vera 2 Create Swap file, add to startup?

From the post (http://forum.micasaverde.com/index.php/topic,8883.msg57979.html#msg57979) I found how to create a swap file on the USB drive.

The steps are as follows:

  1. Data description for 64Mb swapfile for the filesystem:
    dd if=/dev/zero of=/tmp/log/cmh/swapfile bs=1024 count=65536

  2. Creating the actual swapfile:
    mkswap /tmp/log/cmh/swapfile

  3. Start using the newly created swapfile:
    swapon /tmp/log/cmh/swapfile

It appears the swap file does not persist between reboots.

My questions are:

1)-> Can the “swapon /tmp/log/cmh/swapfile” statement be added to the Vera Startup? How?

2)-> Is there any reason or danger in using the swap file. I pursued this as I have 70 some devices, 15 cameras on the system. It is very slow and the FREE cmd shows very little memory.

Memory currently is:
total used free shared buffers
Mem: 30540 30228 312 0 384
Swap: 0 0 0
Total: 30540 30228 312

3)-> Am I approaching/exceeding the practical limitation of devices on Vera2?

I am at UI5 with most recent updates applied.

Thanks.

I have a swap partition running and I recently opened a thread concerning this topic:

http://forum.micasaverde.com/index.php/topic,8883.msg57810.html#msg57810

Maybe that gives you some answers.

I read the thread. Still looking for answer to:

How do I add to startup?

Is there an argument against using a swap file?

Does +70 decides exceed Vera2 capabilities and as such a swap file is pointless?

Thanks.

Sorry, I didn’t read your post closely enough.

I added the following lines to my /etc/init.d/custom-user-setup file to make the swap partition appear after reboot:

# activate swap swapon /dev/scsi/host0/bus0/target0/lun0/part2

So basically you just have to add your swapon command to this file.

If I got that right one of the biggest concern is the limited read/write cycles for an usb stick. Using SWAP on usb will eventually kill the stick, but up to now I had no problems.

Thx much for the info.

Given the low cost of thumb drives I don’t have concerns about chewing up thumb drives.

If it even marginally improves performance, it will be worth it.

Thx

[quote=“PhilTMan, post:1, topic:170059”]From the post (http://forum.micasaverde.com/index.php/topic,8883.msg57979.html#msg57979)

3)-> Am I approaching/exceeding the practical limitation of devices on Vera2?

I am at UI5 with most recent updates applied.

Thanks.[/quote]

By what I read Vera 3 for more than 50 devices. So you maybe exceeding the practical limitation of your Vera 2.

It is more or less the plugins that will cause Vera 2 to use memory. You should be OK with 70 or so devices. Once you start adding many cameras and other plugins, that is when Vera 2 can become slow.

  • Garrett

Is the use of a single plugin for the camera the memory penalty or the number of cameras. All are of the same type, using the built in generic camera support of UI5.

I removed 4 cameras without measurable impact on available memory. Or would I need to remove all cameras?

Would upgrading to vera3 resolve the low memory, slow performance issues?

Thanks for your replies.

Just to let you know, the absolutely biggest performance improvement for me was uninstalling the ergy energy plugin.

Chixxi,

I’ve little Linux experience, soooo…

There was no pre-existing custom-user-setup file. So I created the file you listed in the folder “/etc/init.d”

I saved and rebooted but the swap file was not present after reboot.

Is the literal file name spelled as: “custom-user-setup” with no extension?

Thanks

Oh, my bad: ::slight_smile:

The file is called “custom-user-startup”! (not custom-user-setup)

You can also read this to see how to activate the file:
http://forum.micasaverde.com/index.php/topic,7750.msg55089.html#msg55089
http://forum.micasaverde.com/index.php/topic,7750.msg55123.html#msg55123

Hi,

Another way is:

connect to Vera2 by ssh.

if your swapfile isn’t created do:

dd if=/dev/zero of=/tmp/log/cmh/swapfile bs=1024 count=65536

then

mkswap /tmp/log/cmh/swapfile

create a file named “swap_on” in /etc/init.d and copy the code below:

[code]#!/bin/sh /etc/rc.common

Copyright (C) 2006 OpenWrt.org

START=99
start() {
/sbin/swapon /tmp/log/cmh/swapfile
}
[/code]

give rights for launch:

chmod a+x swap_on

then do:

ln -s  /etc/init.d/swap_on /etc/rc.d/S99swap_on

reboot and check if your swap is on by this command in ssh: free

if you see that (or someting like that) :

Swap: 8940 56 8884

it’s ok.

Gilles.

Thanks much, you instructions worked nicely.