rdashokraj
asked on
Swap space issue in Solaris
Hello,
Sometimes I'm really going mad with Swap space in Solaris? Please look at the below output, based on this i have some questions about Swap space?
root@hotsun# uname -a
SunOS hotsun.travelclick.net 5.8 Generic_117350-14 sun4u sparc SUNW,Sun-Fire-880
root@hotsun# prtconf | grep Mem
Memory size: 16384 Megabytes
root@hotsun# swap -s
total: 13790024k bytes allocated + 99080k reserved = 13889104k used, 10667080k available
root@hotsun# swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d1 85,1 16 23163984 22928464
root@hotsun.travelclick.ne t# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 4691952 2882534 1762499 63% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
/dev/md/dsk/d3 14219619 5033441 9043982 36% /var
swap 10662024 32 10661992 1% /var/run
swap 10784344 122352 10661992 2% /tmp
.
.
root@hotsun# cat /var/adm/messages.0 | grep 'Nov 9'
.
.
Nov 9 03:00:17 hotsun.travelclick.net sendmail[10822]: [ID 801593 mail.alert] mA990F210822: SYSERR(root): savemail: cannot save rejected email anywhere
Nov 9 03:01:41 hotsun.travelclick.net tmpfs: [ID 518458 kern.warning] WARNING: /tmp: File system full, swap space limit exceeded <----------------------
root@hotsun.travelclick.ne t# top
last pid: 27680; load averages: 3.62, 3.59, 3.70
135 processes: 131 sleeping, 4 on cpu
CPU states: 13.1% idle, 39.1% user, 4.4% kernel, 43.3% iowait, 0.0% swap
Memory: 16G real, 14G swap in use, 10G swap free <------------------------- ----------
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
25462 oracle 1 20 0 10G 10G cpu4 48:35 12.45% oracle
24883 oracle 1 20 0 9182M 9136M cpu3 57:07 12.39% oracle
21364 oracle 11 20 0 8406M 8358M cpu1 38:09 3.61% oracle
21362 oracle 11 51 0 8406M 8358M sleep 39:32 3.23% oracle
21366 oracle 11 41 0 8406M 8358M sleep 37:18 2.98% oracle
21360 oracle 11 52 0 8406M 8358M sleep 37:06 2.91% oracle
25423 root 11 60 0 78M 67M sleep 4:32 1.91% bpbkar
27607 oracle 11 58 0 8393M 8345M sleep 0:22 0.38% oracle
27611 oracle 11 58 0 8393M 8345M sleep 0:21 0.38% oracle
27605 oracle 11 58 0 8392M 8347M sleep 0:07 0.21% oracle
27609 oracle 11 58 0 8392M 8344M sleep 0:07 0.20% oracle
27668 root 1 58 0 3168K 2272K cpu6 0:00 0.11% top
148 root 14 59 0 11M 7504K sleep 75:25 0.02% picld
27646 oracle 11 58 0 8391M 8343M sleep 0:00 0.02% oracle
27642 oracle 11 58 0 8391M 8343M sleep 0:00 0.02% oracle
1. Now what is the Total Swap swap space available in the system? From 'swap -l', I could see it is 11 GB. If that is the case, why the 'top' output showing 14G swap in use, 10G swap free?
2. 'top' output shows 14G swap in use, 10G swap free. Please explain this.
3. Due to the following error " /tmp: File system full, swap space limit exceeded ", the Oracle DB running in the server got hung and we were forced to restart the Oracle database. Can you explain why it is and how to prevent it?
4. I persume /tmp filesystem is the Total size of Physical and Swap memory. If that is the case, it should show as 16 GB physical memory + Swap space. But 'df' output just shows approx. around 10 GB. Can you clarify me this?
Thanks,
AR
Sometimes I'm really going mad with Swap space in Solaris? Please look at the below output, based on this i have some questions about Swap space?
root@hotsun# uname -a
SunOS hotsun.travelclick.net 5.8 Generic_117350-14 sun4u sparc SUNW,Sun-Fire-880
root@hotsun# prtconf | grep Mem
Memory size: 16384 Megabytes
root@hotsun# swap -s
total: 13790024k bytes allocated + 99080k reserved = 13889104k used, 10667080k available
root@hotsun# swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d1 85,1 16 23163984 22928464
root@hotsun.travelclick.ne
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 4691952 2882534 1762499 63% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
/dev/md/dsk/d3 14219619 5033441 9043982 36% /var
swap 10662024 32 10661992 1% /var/run
swap 10784344 122352 10661992 2% /tmp
.
.
root@hotsun# cat /var/adm/messages.0 | grep 'Nov 9'
.
.
Nov 9 03:00:17 hotsun.travelclick.net sendmail[10822]: [ID 801593 mail.alert] mA990F210822: SYSERR(root): savemail: cannot save rejected email anywhere
Nov 9 03:01:41 hotsun.travelclick.net tmpfs: [ID 518458 kern.warning] WARNING: /tmp: File system full, swap space limit exceeded <----------------------
root@hotsun.travelclick.ne
last pid: 27680; load averages: 3.62, 3.59, 3.70
135 processes: 131 sleeping, 4 on cpu
CPU states: 13.1% idle, 39.1% user, 4.4% kernel, 43.3% iowait, 0.0% swap
Memory: 16G real, 14G swap in use, 10G swap free <-------------------------
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
25462 oracle 1 20 0 10G 10G cpu4 48:35 12.45% oracle
24883 oracle 1 20 0 9182M 9136M cpu3 57:07 12.39% oracle
21364 oracle 11 20 0 8406M 8358M cpu1 38:09 3.61% oracle
21362 oracle 11 51 0 8406M 8358M sleep 39:32 3.23% oracle
21366 oracle 11 41 0 8406M 8358M sleep 37:18 2.98% oracle
21360 oracle 11 52 0 8406M 8358M sleep 37:06 2.91% oracle
25423 root 11 60 0 78M 67M sleep 4:32 1.91% bpbkar
27607 oracle 11 58 0 8393M 8345M sleep 0:22 0.38% oracle
27611 oracle 11 58 0 8393M 8345M sleep 0:21 0.38% oracle
27605 oracle 11 58 0 8392M 8347M sleep 0:07 0.21% oracle
27609 oracle 11 58 0 8392M 8344M sleep 0:07 0.20% oracle
27668 root 1 58 0 3168K 2272K cpu6 0:00 0.11% top
148 root 14 59 0 11M 7504K sleep 75:25 0.02% picld
27646 oracle 11 58 0 8391M 8343M sleep 0:00 0.02% oracle
27642 oracle 11 58 0 8391M 8343M sleep 0:00 0.02% oracle
1. Now what is the Total Swap swap space available in the system? From 'swap -l', I could see it is 11 GB. If that is the case, why the 'top' output showing 14G swap in use, 10G swap free?
2. 'top' output shows 14G swap in use, 10G swap free. Please explain this.
3. Due to the following error " /tmp: File system full, swap space limit exceeded ", the Oracle DB running in the server got hung and we were forced to restart the Oracle database. Can you explain why it is and how to prevent it?
4. I persume /tmp filesystem is the Total size of Physical and Swap memory. If that is the case, it should show as 16 GB physical memory + Swap space. But 'df' output just shows approx. around 10 GB. Can you clarify me this?
Thanks,
AR
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As I noted, you can set a quota on the size of /tmp, enforcing a buffer that will allow the system to keep running without running out of swap space. Of course applications that need free space in /tmp will start to fail, but it is up to the developers of the applications to handle error conditions gracefully.
See the mount_tmpfs man page for details.
See the mount_tmpfs man page for details.
ASKER
Thankyou so much for your explanation.
ASKER
So if someone creates files of huge size in /tmp filesystem, they can fill up the Swap space and it would potentially can crash the OS itself right? (due to insufficient swap space). If yes, don't you think it is a vulnerability in Solaris OS, that anyone normal user can bring down the application or OS just by creatiing some huge files in /tmp ?