05.08.2013 Views

Solaris Application Programming, 1/e - Chapter 4 - Parent Directory

Solaris Application Programming, 1/e - Chapter 4 - Parent Directory

Solaris Application Programming, 1/e - Chapter 4 - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.3 TOOLS THAT REPORT CURRENT SYSTEM STATUS 57<br />

page: The columns labeled re to sr refer to paging information. The re column<br />

lists the number of pages containing data from files, either executables<br />

or data, that have been accessed again and therefore reclaimed from the list<br />

of free pages. The mf column lists the number of minor page faults, in which a<br />

page was mapped into the process that needed it. The pi column lists the<br />

number of kilobytes paged in from disk and the po column lists the number of<br />

kilobytes paged out to disk. The de column lists the anticipated short-term<br />

memory shortfall in kilobytes, which gives the page scanner a target number<br />

of pages to free up. The sr column lists the number of pages scanned per second.<br />

A high scan rate (sr) is also an indication of low memory, and that the<br />

machine is having to search through memory to find pages to send to disk.<br />

The solution is to either run fewer applications or put more memory into the<br />

machine. Continuously high values of pi and po indicate significant disk<br />

activity, due to either a high volume of I/O or to paging of data to and from<br />

disk when the system runs low on memory.<br />

disk: There is space to report on up to four disk drives, and these columns<br />

show the number of disk operations per second for each of the four drives.<br />

faults: There are three columns on faults (i.e., traps and interrupts). The in<br />

column lists the number of interrupts; these are used for tasks such as handling<br />

a packet of data from the network interface card. The sy column lists<br />

the number of system calls; these are calls into the kernel for the system to<br />

perform a task. The cs column lists the number of context switches, whereby<br />

one thread leaves the CPU and another is placed on the CPU.<br />

cpu: The final three columns are the percentage of user, system, and idle<br />

time. This is an aggregate over all the processors. Example 4.11 shows output<br />

from a two-CPU machine. With an idle time of 50%, this can mean that<br />

both CPUs are busy, but each only half the time, or that only one of the two<br />

CPUs is busy. In an ideal world, most of the time should be spent in user<br />

code, performing computations, rather than in the system, managing<br />

resources. Of course, this does not mean that the time in user code is being<br />

spent efficiently, just that the time isn’t spent in the kernel or being idle.<br />

High levels of system time mean something is wrong, or the application is<br />

making many system calls. Investigating the cause of high system time is<br />

always worthwhile.<br />

4.3.3 Reporting Swap File Usage (swap)<br />

Swap space is disk space reserved for anonymous data (data that is not otherwise<br />

held on a filesystem). You can use the swap command to add and delete swap space<br />

from a system. It can also list the locations of swap space using the -l flag, and

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!