Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 








Paging and Swapping Devices

Linux Tips by Burleson Consulting

Linux uses a swap disk as a repository for segments of memory that are paged out from physical RAM.  Linux will use swap very intelligently even when sufficient physical memory is available.  When too many things are running at once and the demand for memory exceeds the size of physical memory excessive paging will likely take place, eventually impacting system performance.  The Linux default is to set the size of the swap disk to twice the size of physical RAM installed in the server.

Linux stores information about devices used for system paging and swapping activities in a file called /proc/swaps. To display information regarding swap devices, the file can be displayed using either the cat command or the swapon command with the -s option. As shown below, the results are the same using either method.

# cat /proc/swaps

Filename                                Type            Size    Used    Priority
/dev/hdf2                               partition       524152  0       -1
# swapon -s
Filename                                Type            Size    Used    Priority
/dev/hdf2                               partition       524152  0       -1

Here we see the device name, type, size and amount used for each swap device.  In this case we only have the one swap device.

Kernel Parameters

Linux is a parameter driven system. Kernel parameters used for system configuration are found in /proc/sys/kernel, where there is an individual file for each configuration parameter. Since these parameters have a direct effect on system performance, root access is required in order to modify them.

You can view the current configuration parameters by using the cat command on the appropriate file.

# cat msgmax

Occasionally, a prerequisite to a software installation requires the modification of kernel parameters.  Since each parameter file contains a single line of data consisting of either a text string or numeric values, it is often easy to modify a parameter by simply using the echo command:

# echo 2048 > /proc/sys/kernel/msgmax

The aforementioned command will set the value of the msgmax parameter to 2048.  This change will only remain in effect until the system is rebooted.

Linux also provides the sysctl command to modify kernel parameters at runtime. sysctl uses parameter information stored in a file called /etc/sysctl.conf. If, for example, we needed to change the value of the msgmax parameter as was accomplished above, we could accomplish the same thing with the sysctl command like this:

# sysctl -w kernel.msgmax=2048

The next section will introduce some useful utilities that are provided with most Linux releases.  These utilities allow some interactive monitoring of the system.

Server monitoring commands

Some popular commands/utilities for monitoring system resources and tasks managed by the Linux kernel are as follows:

* top: Provides a dynamic real-time view of a running system, including information about system resource usage and a constantly updated list of the processes which are consuming the most resources.  Because it is so useful for administration we will talk quite a bit about top in chapter 8.

* mpstat: Reports activities for each available processor, processor zero being the first one reported.  Global average activities across all processors are also reported.

* iostat: Used for monitoring the load on system input/output devices by observing the time the devices are active compared to the average transfer rate of the device.

* vmstat: Displays information about processes, memory, paging, block IO, and different levels of CPU activity

Interactive Statistics using the top Utility

The top program provides a dynamic real-time view of a running Linux system.  This can be one of the most useful ways to monitor the system as it shows several key statistics on the same page with information on the busiest processes.  It is also one of the few commands which will constantly update.  For more information on the top utility refer to chapter 8.

Displaying Multi-Processor Statistics

The mpstat command displays statistics for each and every processor within the system. The mpstat command accepts interval (delay) and count (repeat) values as parameters.  mpstat will repeat the output count times every interval seconds.  This is very useful for monitoring changes over time.

The following example uses an interval of three seconds and a count of five iterations of the report detail lines. An average summary line is produced at the end of the report.

$ mpstat 3 5

Linux 2.6.5-1.358 (Dell-Linux)  10/18/2004
10:33:26 PM  CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s
10:33:29 PM  all    1.00    0.00    0.33    0.00    0.00    0.00   98.67   1001.99
10:33:32 PM  all    0.33    0.00    0.33    0.00    0.00    0.00   99.33   1007.02
10:33:35 PM  all    0.67    0.00    0.33    0.00    0.00    0.00   99.00   1002.67
10:33:38 PM  all    0.66    0.00    0.33    0.00    0.00    0.00   99.00   1000.33
10:33:41 PM  all    0.67    0.00    0.33    0.00    0.00    0.00   99.00   1005.67
Average:     all    0.67    0.00    0.33    0.00    0.00    0.00   99.00   1003.53

The columns in the report generated by the mpstat command are defined as follows:

* CPU: Either the processor number or the keyword all, which indicates that statistics are calculated as averages among all processors or that there is only one processor in the server

* %user: The percentage of CPU used by user applications

* %nice: The percentage of CPU utilization at the user level with nice priority

* %system: The percentage of CPU used by the system. This does not include the time spent servicing interrupts or softirqs. A softirq is a software interrupt, one of up to 32 software interrupts which can run on multiple CPUs simultaneously.

* %iowait: The percentage of time the system had a pending disk I/O request

* %irq: The percentage of time spent by the CPUs servicing interrupts

* %soft: The percentage of time the processors spent servicing softirqs.

* %idle: The percentage of time that the processors were idle and the system did not have a pending disk I/O request.

* intr/s: The total number of interrupts per second received by the processor(s)

The information from the mpstat report can be used to determine if processor load is being distributed evenly across the existing processors and if the multi-processing capabilities of the server are being utilized effectively.

This is an excerpt from "Easy Linux Commands" by Linux guru Jon Emmons.  You can purchase it for only $19.95 (30%-off) at this link.



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational