Solaris 8 paging


Monday, April 07, 2003
What do all the TCP states actually mean?

a. CLOSED (0)
1. Socket is closed
b. LISTEN (1)
1. Socket is passive, awaiting a connection request
c. SYN_SENT (2)
1. Socket is active, has sent a SYN
2. Session not yet active
d. SYN_RECEIVED (3)
1. Socket is active, has sent and received SYN
2. Session not yet active
e. ESTABLISHED (4)
1. Socket is active
2. Session is active, has completed handshake
f. CLOSE_WAIT (5)
1. Socket is closed, received FIN, waiting for close
2. Session is terminating
g. FIN_WAIT (6)
1. Socket is closed, sent FIN, waiting for FIN ACK
2. Session is terminating
h. CLOSING (7)
1. Socket is closed, exchanged FIN, waiting for FIN ACK
2. Session is terminating
i. LAST_ACK (8)
1. Socket is closed, received FIN, waiting for FIN ACK
2. Session is terminating
j. FIN_WAIT_2 (9)
1. Socket is closed, received FIN ACK
2. Session is complete
k. TIME_WAIT (10)
1. Socket is closed, waits for ( 2 * max segment life )
2. Session is complete



Tuesday, March 04, 2003
Questions to answer about memory
==============================
1. how fast is memory?

2. how constrained is memory in a given system?

3. how much memory does a specific process consume?


Good URLS:
http://www.oreilly.com/catalog/spt2/chapter/ch04.html


DEFINITIONS FOR MEMORY ALLOCATION
================================


'Kbytes' is the total memory size of the process or file.
'Resident' is that portion currently occupying physical memory.
'Shared' is resident memory capable of being shared.
'Private' is resident memory unique to this process or file.
Resident = Shared + Private



Friday, February 28, 2003
SWAP SPACE

Two important states:

1) amount virtual swap space congured and available for swap reservations

2) amount physical swap space that is configured and available for physical page-outs



If virtual swap space is exhausted, malloc () and related calls fail thereby causing programs to fail.


If physical swap space is exhausted, programs don't fail, but since no space to page them out kernel locks down memory that would normally be paged out.


Useful Tools for Memory and Swap:
=================================

Display Swapping Statistics
vmstat -S
procs memory page disk faults
r b w swap free si so pi po fr de sr s3 sd sd sd in sy cs u
1 0 0 6058320 1314336 0 0 51 75 85 0 21 0 12 10 4 744 1999 709

si = Average number of LWPs swapped in per second
so = Number of whole processes swapped out



swap -l
Determine how much swap space is currently available
swapfile dev swaplo blocks free
/dev/vx/dsk/swapvol 195,8 16 4197856 4110240
/dev/dsk/c1t6d0s0 118,48 16 6761824 6681760



prtswap -l
Shows:
1. Free virtual swap
2. unallocated virtual swap
3. allocated virtual swap
4. used physical swap

Memtool
VERY USEFUL for system managment and sizing memory



Physical memory is classified into four types:


1. Kernel memory mapped into kernel address space


2. Process memory is mapped into a process address space


3. Filesystem cache memory that is not mapped into any address space


4. Free memory that is not mapped into any address space





SHARED LIBRARY SPACE


The nice part of shared libraries is that if each process has it's own virtual address space, and the virtual addresses for, say, libc.so.1 from two different processes both map to the same physical address.

No swap is used for shared libraries. Pages from files that have a name in the filesystem (i.e. pages that are not anonymous) use the file as backing store, and thus do not need swap.



Possible reasons for swap space full:


1) Significant amount of files are writing to /tmp


2) A memory leak, process is leaking backed by swap


3) To many processes are being swapped, swap is not sized properly




Sun has redesigned their memory architecture for Solaris 8. It is recommend any priority paging and UFS write throttle settings be removed from the /etc/system file.

Prior to Solaris 8, there was no distinction between virtual memory used for file data and that used for programs. This meant that program data could be forced out of physical memory by the file system cache when there was a lot of file system activity. This tended to degrade app performance since app involved a lot of file access and also tended to make Solaris sluggish in switching between tasks.