Chapter 4. Physical and Virtual Memory
53
To learn more about the swapping activity is taking place, use the
sar W
report. Here is an example:
Linux 2.4.18 18.8.0 (pigdog.example.com)
12/17/2002
12:00:01 AM
pswpin/s pswpout/s
12:10:01 AM
0.15
2.56
12:20:00 AM
0.00
0.00
...
03:30:01 PM
0.42
2.56
Average:
0.11
0.37
Here we can see that, on average, there were three times fewer pages being brought in from swap
(
pswpin/s
) as there were going out to swap (
pswpout/s
).
To better understand how pages are being used, refer to the
sar B
report:
Linux 2.4.18 18.8.0smp (raptor.example.com)
12/16/2002
12:00:01 AM
pgpgin/s pgpgout/s
activepg
inadtypg
inaclnpg
inatarpg
12:10:00 AM
0.03
8.61
195393
20654
30352
49279
12:20:00 AM
0.01
7.51
195385
20655
30336
49275
...
08:40:00 PM
0.00
7.79
71236
1371
6760
15873
Average:
201.54
201.54
169367
18999
35146
44702
Here we can view how many blocks per second are paged in from disk (
pgpgin/s
) and paged out to
disk (
pgpgout/s
). These statistics serve as a barometer of overall virtual memory activity.
However, more knowledge can be gained by looking at the other fields in this report. The Red Hat
Linux kernel marks all pages as either active or inactive. As the names imply, active pages are cur
rently in use in some manner (as process or buffer pages, for example), while inactive pages are not.
This example report shows that the list of active pages (the
activepg
field) averages approximately
660MB
3
.
The remainder of the fields in this report concentrate on the inactive list pages that, for one reason
or another, have not recently been used. The
inadtypg
field shows how many inactive pages are dirty
(modified) and may need to be written to disk. The
inaclnpg
field, on the other hand, shows how
many inactive pages are clean (unmodified) and do not need to be written to disk.
The
inatarpg
field represents the desired size of the inactive list. This value is calculated by the
Linux kernel and is sized such that the inactive list be large enough to act as a reasonable pool for
page replacement purposes.
For additional insight into page status (specifically, how often pages change status), use the
sar R
report. Here is a sample report:
Linux 2.4.18 18.8.0smp (raptor.example.com)
12/16/2002
12:00:01 AM
frmpg/s
shmpg/s
bufpg/s
campg/s
12:10:00 AM
0.10
0.00
0.12
0.07
12:20:00 AM
0.02
0.00
0.19
0.07
...
08:50:01 PM
3.19
0.00
0.46
0.81
Average:
0.01
0.00
0.00
0.00
The statistics in this particular
sar
report are unique, in that they may be positive, negative, or zero.
When positive, the value indicates the rate at which pages of this type are increasing. When negative,
3. The page size under Red Hat Linux on the x86 architecture is 4096 bytes
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved