opensolaris – increase swap

I found this on opensolaris forums…. A nice way to increase your swap without the need for a reboot.

First check your current swap size and details;

swap -lh

or

zfs list

Then create a temp swap zfs store and delete and increase swap

zfs create -V <old size> rpool/swp
swap -a /dev/zvol/dsk/rpool/swp
swap -d /dev/zvol/dsk/rpool/swap
zfs destroy rpool/swap
zfs create -V <new size> rpool/swap
swap -a /dev/zvol/dsk/rpool/swap
swap -d /dev/zvol/dsk/rpool/swp
zfs destroy rpool/swp

Done.

If you are happy to reboot…

zfs set volsize=8G rpool/swap
reboot

zfs – now has dedup!

Cool. zfs as of version 21 has deduplication built in. And thats the good dedup – synchronous dedup. i.e. deduped on the fly!

How easy is it to turn on? – very!

Once you have upgraded your zpool to 21 or above you can run the following command at the pool level and deduplication will be over all your data from that point onwards.

zpool set dedup=on tank

Done

Note : Watch your performance, it will drop like a rock if you do not have enough ram for your dedup tables. Do some tests after enabling this feature.

http://hub.opensolaris.org/bin/view/Community+Group+zfs/dedup

Opensolaris – where has my memory gone?

Use this command in 2008.11 to get details on where your memory is currently being used…

echo ::memstat | pfexec mdb -k

Page Summary                Pages                MB  %Tot
————     —————-  —————-  —-
Kernel                     263992              1031   34%
ZFS File Data               91917               359   12%
Anon                       376867              1472   48%
Exec and libs               11484                44    1%
Page cache                   3387                13    0%
Free (cachelist)             9766                38    1%
Free (freelist)             24807                96    3%

Total                      782220              3055
Physical                   782219              3055

Note: ZFS should eat up the remainder of your ram after a bit of use.

“ZFS File Data” is the one to look at – if it is low then most of your ram may be eaten up in other areas of the system.

From the output above you can see that i have 3GB installed. I have a few VirtualBox VM’s running on my server which show up as “Anon”, they are consuming almost half of my ram.