Tuning I/O resources

Tuning serial device resources

You can use the sar -y and sar -g commands (or their mpsar equivalents for SMP) to examine the performance of the terminal (tty) and serial I/O drivers.

sar -y reports character processing and hardware interrupt activity in the tty and serial drivers:

   23:59:44 rawch/s canch/s outch/s rcvin/s xmtin/s mdmin/s
   23:59:49      10      10      25      11      11       0
   23:59:54      12      10      34      14      14       0 
   23:59:59       8       8      12       8       8       0

Average 10 9 24 11 11 0

For dumb serial cards using 8250 or 16450 UARTs, the ratio of the number of interrupts received from the serial card per second, rcvin/s, to the number of raw characters received per second, rawch/s, should be close to 1. Non-intelligent (dumb) serial cards that use the 16550 UART can buffer up to 14 characters before generating an interrupt. In this case, the ratio could be as low as 0.07 but will usually be nearer 1 if continuous input is not arriving. Intelligent serial cards move many more characters per interrupt and so cause much less loading of the CPU.

If the users of your system are logged in over serial lines, you should monitor rawch/s and rcvin/s over time to gain an impression of typical values for the rates of raw character input and interrupt activity for the serial card(s) on your system. If you are using intelligent multiport cards, these are usually supplied with software that you can use to diagnose their performance.

You should also examine the values of rawch/s and rcvin/s if you suspect that a bad line or chattering terminal is generating spurious interrupts. If any serial devices are being used with modem control, you can also examine the number of modem interrupts per second shown by mdmin/s. These interrupts are generated when the modem-control lines, such as RTS, and CTS, change state.

The CPU has to handle all interrupts that it receives from serial cards. If the number it has to handle is very high, it will be interrupt bound and may be unable to allocate sufficient time to running user applications. In extreme cases, characters may be lost if interrupts arrive while other interrupts are still waiting to be processed. This is known as interrupt overrun.

When using fast modems, too many characters may arrive in the UART's buffer while the interrupt handler is trying to process them. This is referred to as high interrupt latency. In such a case, the buffer may lose the last character to arrive. To prevent this, you need to decrease the number of characters in the buffer that will cause the UART to generate an interrupt (the receive interrupt trigger level). You should also increase the values of the kernel parameters NCLIST and TTHOG to match the increased demand on the terminal and serial drivers. TTHOG controls how many characters are allowed to be on the raw queue of the terminal driver (see ``Processing of input and output characters by the character list-based terminal driver'') before the driver will automatically dispose of them. You must also increase the number of character list blocks, defined by NCLIST, to allow the raw queue to grow to such a size. See ``Configuring your system for high-speed modems'' for more details.

sar -g reports interrupt overruns and lost characters in the serial I/O (sio) driver, and any shortage of character list buffers in the tty driver:

   23:59:44 ovsiohw/s ovsiodma/s ovclist/s
   23:59:49      0.00       0.00      0.00
   23:59:54      0.00       0.00      0.00
   23:59:59      0.00       0.00      0.00

Average 0.00 0.00 0.00

ovsiohw/s shows the number of interrupt overruns per second. If this value is greater than zero and your system supports many users logged in over serial lines, you should consider upgrading to intelligent multiport cards or network terminal concentrators. Alternatively, reduce the number of interrupts generated per incoming character by increasing the interrupt trigger level on all serial ports that are connected to terminals.

ovsiodma/s shows the number of times per second that the serial driver lost input characters because there was insufficient space in the receiver cache. This is most likely to occur on a serial port receiving incoming data from a modem. If the value of ovsiodma/s is greater than zero, reduce the interrupt trigger level on serial ports that are connected to modems, and increase the values of NCLIST and TTHOG.

ovclist/s shows the number of times per second that the serial driver ran out of character list buffers. If this value is greater than zero, examine the number of these buffers using the command:


Increase the current number of character list buffers using:

setconf KERNEL_CLISTS number

until ovclist/s drops back to zero. Use configure(ADM) to change NCLIST to this new value.

The following table is a summary of the commands that can be used to view terminal and serial driver activity:

Viewing serial and terminal driver activity

Command Field Description
[mp]sar -y rawch/s number of characters per second handled on the raw input queue
  rcvin/s number of interrupts per second notifying that hardware has received input
  mdmin/s number of modem interrupts per second
[mp]sar -g ovsiohw/s number of serial driver interrupt overruns per second
  ovsiodma/s number of times per second that the serial driver lost input characters
  ovclist/s number of times per second that the system ran out of character list buffers

Next topic: Configuring your system for high-speed modems
Previous topic: Processing of input and output characters by the character list-based terminal driver

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003