Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [452]

By Root 2729 0
because the paging events that determine the next average value of free have not yet occurred.

A page-in does not necessarily represent a page being recovered from the swap area. It could be executable code being paged in from a filesystem or could be a copy-on-write page being duplicated, both of which are normal occurrences that do not necessarily indicate a shortage of memory. On the other hand, page-outs always represent data being forcibly ejected by the kernel.

If your system has a constant stream of page-outs, you need more memory. But if paging happens only occasionally and does not produce annoying hiccups or user complaints, you can ignore it. If your system falls somewhere in the middle, further analysis should depend on whether you are trying to optimize for interactive performance (e.g., a workstation) or to configure a machine with many simultaneous users (e.g., a compute server).

If half the operations are page-outs, you can figure that every 50 page-outs cause about one second of latency. If 75 page-outs must occur to let you scroll a window, you will wait for about 1.5 seconds. A rule of thumb used by interface researchers is that an average user perceives the system to be “slow” when response times are longer than seven-tenths of a second.

Analyzing disk I/O


Most systems allow disk throughput to be monitored with the iostat command. Like vmstat, it takes optional arguments to specify an interval in seconds and a repetition count, and its first line of output is a summary since boot. Like vmstat, it also tells you how the CPU’s time is being spent.

% iostat 5 5

tty sd0 sd1 nfs1 cpu

tin tout kps tps serv kps tps serv kps tps serv us sy wt id

0 1 5 1 18 14 2 20 0 0 0 0 0 0 99

0 39 0 0 0 2 0 14 0 0 0 0 0 0 100

2 26 3 0 13 8 1 21 0 0 0 0 0 0 100

3 119 0 0 0 19 2 13 0 0 0 0 1 1 98

1 16 5 1 19 0 0 0 0 0 0 0 0 0 100

Columns are divided into topics (in this case, five: tty, sd0, sd1, nfs1, and cpu), with the data for each topic presented in the fields beneath it. iostat output tends to be somewhat different on every system. (This output is from Solaris.)

The tty topic presents data concerning terminals and pseudo-terminals. This information is basically uninteresting, although it might be useful for characterizing the throughput of a modem. The tin and tout columns give the average total number of characters input and output per second by all of the system’s terminals.

Each hard disk has columns kps, tps, and serv, indicating kilobytes transferred per second, total transfers per second, and average “service times” (seek times, essentially) in milliseconds. One transfer request can include several sectors, so the ratio between kps and tps tells you whether there are a few large transfers or lots of small ones. Large transfers are more efficient. Calculation of seek times seems to work only on specific drives and sometimes gives bizarre values (the values in this example are reasonable).

Some systems support iostat -D, which gives the percentage utilization of each disk.

% iostat -D 5 5

sd1 sd2 sd3 sd5

rps wps util rps wps util rps wps util rps wps util

0 0 1.3 0 0 0.3 0 0 0.5 1 1 4.2

9 8 41.1 1 0 1.8 1 0 2.4 6 8 34.8

11 4 48.4 0 1 2.0 0 0 0.0 3 11 32.6

8 0 15.6 0 0 0.0 0 0 0.0 3 0 9.2

0 0 0.0 0 0 0.0 0 0 0.0 0 0 0.0

Here, volumes are quoted in reads and writes per second.

The cost of seeking is the most important factor affecting disk drive performance. To a first approximation, the rotational speed of the disk and the speed of the bus it’s connected to have relatively little impact. Modern disks can transfer dozens of megabytes of data per second if they are read from contiguous sectors, but they can only perform about 100 to 300 seeks per second. If you transfer one sector per seek, you can easily realize less than 5% of the drive’s peak throughput.

Seeks are more expensive when they make the heads travel a long distance. If you have a disk with several filesystem partitions and files are read from each partition in a random order, the heads will have to travel back and

Return Main Page Previous Page Next Page

®Online Book Reader