Tuesday 9 August 2011

Paging Space in AIX

AIX Paging Space with Diagrams.

Objectives for the module

• What is Paging Space ?
• Define the requirement of Paging Space
• Maintain paging space
• Troubleshoot paging space problems


Introduction: Paging Space


Explanation:

•Virtual Memory Manager (VMM) manages paging and virtual storage related issues on your AIX.

•A running application is called as a process and these processes have to be loaded on the memory. These processes occupy 4 kb blocks on the memory called pages. As more and more processes increase on your system, the pages on the memory may not be enough for the processes to be loaded. At this juncture the inactive pages belonging to a process is moved out of the memory into the disk space called “Paging Space”, this process is called Page Out. And when-ever these inactive pages are required again by the process, they have to moved back again onto the RAM, this process is called Page In.

•The Paging Space is nothing but a area on your hard disk that contains these moved in inactive pages of the memory.

Paging Space

•Is a logical partition on the hard disk
•Acts as a temporary storage place for the “pages
•Cannot be used as RAM

Explanation:

•Paging Space holds the inactive memory frames.

•Paging space just acts as a temporary storage area for the in-active pages and cannot be treated as a substitute for RAM. If enough memory is not available on your machine, you may get into a scenario called thrashing.

Thrashing: Trashing is a state of paging when you do not have enough memory. When the VMM attempts to make place for a new process in the memory by moving an in-active page into the paging area, the process will need that page again in the memory wherein now VMM has to perform Page-In activity to put back the page again into the memory. Your machine is too busy only doing Page-Out and Page-In activity and no real work is done on your machine.
•In a scenario where there is thrashing, you may not be able to solve the problem just by increasing the paging space but you may have to increase your RAM to solve this problem.

Paging Space –Criteria

•Thumb rule –twice the size of RAM
•Recommendations:
–Have only one paging space per disk.
–Do not stretch paging space logical volume to spread across more than one physical volume.
–The size of paging space should be roughly same.
–Do not create paging space on a busy hard disk.

Explanation:

•Paging Space is created during the AIX installation. As a thumb rule usually the paging space is set twice of your RAM, but actually this calculation of the size of the paging space actually depends on the amount of RAM available on your system.

•If the RAM is greater than or equal to 64MB, the paging space is RAM+16 MB. If RAM is less than 64 MB, paging space is twice the size of RAM.

•When you are running low on paging space, you may get some errors like this:
 #
 Ksh: cannot fork no swap space

•At this point you will not be able to start any new processes until some processes are terminated.

 Recommendations:
•Do not have more than one paging space per hard disk as paging space is allocated in a round robin manner and will use all paging areas equally. If you have two paging spaces on one disk, then you are no longer utilizing the other disks for paging activity. Do not have paging space on an already burdened hard disk. Roughly the paging spaces should be of the same size so that paging activity is balanced and faster. The paging space as a recommendation, should not span multiple hard disks.

Managing Paging Space

Use the # lsps –a command to check the paging activity.

Paging space information is stored in the file /etc/ swapspaces 

Explanation:

•Monitoring the paging activity can be done with the command lsps–a.

•This command shows you the page spaces, on which hard disk they have been created, which volume group they belong to , their size, usage, whether active or not etc.

•The file /etc/ swapspaceswill hold details about the paging spaces. This file contains information about the paging areas, their logical devices names etc.

Creating a Paging space


Explanation:

•During the installation of AIX itself , system defined paging space is created. If its required you can use the smit fastpath mkps to create a new paging space
 # smit mkps
•You may have to specify the volume group name where you are planning to create the paging space, size of the paging space and the hard disk on which you are planning to create it.
•You can use the option Start using this paging space NOW to activate the paging space immediately for use and you can use the option Use this paging space each time system is RESTARTED to activate the paging space at the next restart.


Modifying Paging Space settings



Explanation:


•If you want to change the settings of the paging space, you can do that by using the smit fast path chps.
 #smit chps


•You can decrease the paging space or you can increase the paging space. The option of decreasing the paging space is newly added in AIX Ver5.1 and it internally uses a high level command called shrinkps o do the same.

•The system default paging space i.e. hd6 cannot be decreased below 32 MB.

Remove Paging Space


To Remove Paging space,
a. Make the paging space inactive by using the swapoff command
# swapoff /dev/paging01


b. Remove inactive paging space
# rmps paging01



Explanation:


•If you have too much of paging space and the usage is low, extra paging space can be deleted.

•Active paging spaces has to be deactivated ( which is possible dynamically from AIX Ver5.1) before you delete it.

Swapoff command along with the paging space logical name can be used to deactivate a paging space and then you can use the rmpscommand to remove the paging space.


Problems with Paging Space


•Paging space too small:

Dynamically increase the size by allocating more partitions
chps -s LogicalPartitions PagingSpace
Example:
# chps -s 1 paging00

•Paging space too large:
Dynamically decrease the size by deallocating partitions
chps -d LogicalPartitions PagingSpace
Example:
# chps -d 1 paging00


Explanation:



•If the paging space is too small, it can be dynamically increased like any other logical volume.

•If the paging space is too large, then you can use the chpscommand to decrease the paging space.
 # chps –d 2 paging01

 -d 2-> delete 2 logical partitions

 Paging01-> paging space name

#######################END#######################

Incoming Search Terms:
Paging space for AIX
Paging Space
Paging Space in Unix
AIX paging space commands
Paging space commands for AIX
Complete list of AIX paging space commands
chps command in AIX