How do I add extra ZFS swap in Solaris 11.3?


 
Thread Tools Search this Thread
Operating Systems Solaris How do I add extra ZFS swap in Solaris 11.3?
# 1  
Old 01-10-2019
How do I add extra ZFS swap in Solaris 11.3?

Hello,

I have given 3 x 1 TB LUNs to add more swap space in a Solaris 11.3 OS

Code:
-bash-4.4# swap -l
swapfile                 dev            swaplo      blocks        free
/dev/zvol/dsk/rpool/swap 303,1              16     8388592     8388592
-bash-4.4# swap -s
total: 84780376k bytes allocated + 157031888k reserved = 241812264k used, 1495043920k available
-bash-4.4# zfs list | grep rpool/swap
rpool/swap                                           4.13G  33.1G  4.00G  -
-bash-4.4#

Adding or Changing Swap Space in an Oracle Solaris ZFS Root Environment - Oracle Solaris 11.1 Administration: Devices and File Systems
Above Oracle Document states that you can expand your swap from rpool. However, there is not enough space in my rpool to do it.

Please your assistance as this is urgent matter.
# 2  
Old 01-11-2019
Altho by default, solaris will create zvol under rpool for swap, one can use regular disk for it, a file or a zvol (3 options) from anywhere available.

Since your requirement is to have 3x1 TB of swap (??), i would go with disk backed devices.
Create a slice a on each disk, starting from 1st sector (not zero).
Add a swap device to configuration using swap -a <yourdisk><slice_number>
Modify the /etc/vfstab to have it after reboot.

Now you will have both ZVOL and new added disk listed under swap -l.
Remove the zvol via swap -d, the entry from /etc/vfstab, and using zfs command destroy the zvol.
The last operation might fail if swap is used (or has been used in past), then reboot will be required to remove it.

Question for you is, 3 TB of swap seems unreasonably high, why do you have requirement for such large swap space ?
Also, using fibre luns as swap could lead to terrible things to your infrastructure and storage, if you start using all that space...
How much memory do you have on that box ?

Hope that helps
Regards
Peasant.
This User Gave Thanks to Peasant For This Post:
# 3  
Old 01-11-2019
Hello Peasant,

Thank you for your troubleshoot.

System has 2 TB physical memory and several zones are being build on it. The 3 TB swap comes from a recommendation to have 1.5 times RAM. This gave relief to our system which experienced severe performance issues.

This is what I did in my undertanding:

Code:
zpool create -m none extra c0t6d0 c0t6d1 c0t6d2
zfs create -p -V 2900G extra/swap2
zfs set primarycache=metadata extra/swap2
swap -a /dev/zvol/dsk/extra/swap2
swap -l

# 4  
Old 01-11-2019
Hi Feroccimx,

I would say that if you have a system with 2Tb of memory and have experienced performance issues, it is much more likely to be an application or configuration issue. A 3Tb swap area is inordinately large and as ZFS will use large portions of local memory for paging and swapping, moving significant ammounts of that to disk will impact performance of the SAN in a significant way.

I think that there is a need for some serious analysis work.

Regards

Gull04
# 5  
Old 01-11-2019
Huh, please point me where have you read that you need 1.5 X swap space, with 2 TB ram ?
I see no reason to have more then 1/4, which is more then enough.

What are you running in those zones ?

Regards
Peasant.
# 6  
Old 01-11-2019
Quote:
Originally Posted by feroccimx
The 3 TB swap comes from a recommendation to have 1.5 times RAM. This gave relief to our system which experienced severe performance issues.
Were they performance issues (like thrashing) or reliability issues (like coredumps)?

In general, increasing the swap area size is not expected to significantly improve performance (although in your case, the swap area is very undersized), but it can prevent programs to crash or to fail to start.

According to the statistics you wrote on the first post, there is 1.7T of virtual memory on your system with a tiny 4G being backed by your existing swap area.

The system is using 240 G of this virtual memory, two third of which being only reserved. You need at least 150 G of swap not to waste RAM (reserved size).

The actual swap size requirement depends on what precisely is running on your machine and each application way to use memory, but also about your dumpadm configuration. In case of a kernel panic, you might want to save the crashdump for further analysis and then a large swap area, like between 1/4 to 3/4 of the RAM size would make sense.

In any case, as long as the file systems also have enough free space, too large a swap doesn't hurt performance. There is a common misconception that a large swap will induce pagination. It doesn't make sense. What triggers pagination is RAM shortage, not swap availability.
This User Gave Thanks to jlliagre For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Swap Solaris 5.10

I have a customers that is getting grid alerts that swap is over 95% utilized. When I do swap -l on the machine I get the following results. $ swap -l swapfile dev swaplo blocks free /swap/swapfile - 16 6291440 6291440 /swap/swapfile2 - 16 8191984... (18 Replies)
Discussion started by: Michael.McGraw
18 Replies

2. Solaris

dual boot solaris/solaris zfs file system

Hi, I am running into a some problems creating a dual boot system of 2 solaris instances using ZFS file system and I was wondering if someone can help me out. First some back ground. I have been asked to change the file system of our server from UFS to ZFS. Currently we are using Solaris... (3 Replies)
Discussion started by: estammis
3 Replies

3. UNIX for Dummies Questions & Answers

Add extra columns help

Hi Gurus, This below script adds a column extra to my flat file..But how can i add another column, Say if i just put mention an other column beside the first column..it does get generated but as one column only while IFS="" read r; do printf "dummy\t%s\n" "$r" done < xxx.txt > zzz.txt ... (9 Replies)
Discussion started by: saggiboy10
9 Replies

4. Solaris

increase SWAP on ZFS file system

Hi All, I am using this commands to dynamically increase ZFS swap space on Solaris my question is: 1- after i make these commands it will permanent or it will remove after restart 2- how to make it permanent # swap -l swapfile dev swaplo bloques libre /dev/zvol/dsk/rpool/swap... (4 Replies)
Discussion started by: osmanux
4 Replies

5. Solaris

Solaris 10 SWAP SPACE

We have a SPARC system which is running on Solaris-9 and Physical memory size is 16GB.We have allocated 32GB SWAP space(2 times of physical memory).But when we use df -h command it shows following output and SWAP space size shows more than our allocated space # df -h Filesystem size used... (2 Replies)
Discussion started by: cyberdemon
2 Replies

6. Solaris

Solaris 10 - Memory / Swap

Hi all Got myself in a pickle here, chasing my own tail and am confused. Im trying to work out memory / swap on my solaris 10 server, that Im using zones on. Server A has 32Gb of raw memory, ZFS across the root /mirror drives. # prtdiag -v | grep mem = Memory size: 32768 Megabytes #... (1 Reply)
Discussion started by: sbk1972
1 Replies

7. Solaris

How can I create a new swap location in ZFS?

I am running OpenSolaris v5.11 During installation, the installation created default ZFS filesystems, like the dump and swap locations. I want to change the blocksize of the /dump and /swap locations and make them ZFS volumes. The ZFS system is on a zpool called rpool I was able to do... (4 Replies)
Discussion started by: sqa777
4 Replies

8. Linux

How to add and extra hour to the start time

Hi Actually what am trying to ask is , i have an shell script ,now i want to run this shell script for one hour continuously and after one hour it has to stop automatically. can any one suggest me how to automate the shell script ? we tried wth the getting the start time and add ing an hour... (8 Replies)
Discussion started by: lalitka
8 Replies

9. Solaris

Solaris 10 ZFS

I'm typing on a nice Sunblade 100 that is willing to be a lab rat for my experiments. I installed Solaris 10 and want to mess with ZFS. Does anyone have any docs on how to install zfs or how to convert my current UFS filesystems to ZFS? Does anyone have any experiences good or bad with ZFS... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies
Login or Register to Ask a Question