Chapter 7. System Performance

This chapter contains information on the tasks and tools that allow you to monitor and enhance performance on your workstation. It covers the following major topics:

Setting Up Swap Space

You can use the Swap Manager and its related guides available through the System Manager to add or remove real or virtual swap space on your system.

Click on one of the links below for more information on that topic:

Understanding Swap Space

Each time you start an application, it communicates to the system that it needs a certain amount of memory in order to run. The system then reserves the amount of physical memory (RAM) that the application requires. If the application needs more memory than is available in RAM, the system then uses a portion of your disk as supplemental memory. This portion of your disk (the file) is known as swap space.

Once the system reserves the required memory (RAM plus swap space), the space is no longer available for use by other applications. If you regularly run an application that requires more memory than the system provides by default (the amount of physical RAM plus the default /dev/swap file), or if you run several large applications at once, you may need to add more swap space.

When you are nearly out of swap space, applications run very slowly; when you are completely out of space, the system may stop an application or UNIX process from running to avoid a system crash. The system notifies you that you need more swap space in three ways:

  • The System Monitor warns you when you are almost out of swap space, and warns you again when you are completely out of space.

  • The Console window displays an “Out of logical swap space” message when you have run out of swap space.

  • The system adds information to the /var/adm/SYSLOG file each time you run out of swap space.

You can add one or both of the following types of swap space:

  • Logical swap space is actual disk space that the system uses as if it were memory (RAM). By default, your system allocates 40 MB of your disk in the /dev/swap file.

    The only disadvantage to adding logical swap space is that it creates a file that consumes a portion of your disk space. To add swap space by creating a file on your system, see “Adding Real Swap Space”.

  • Virtual swap space is a file that the system considers to be a certain size (for example, 40 MB) but actually occupies no disk space. This is useful because many programs request much more swap space than they really need in order to run, and tie up the real swap space unnecessarily. When you add virtual swap space, the system lets you start applications even when they request more swap space than is actually available. In most cases this is fine, because there is enough real swap space for them to run.

    The advantage of virtual swap space is that it does not consume any disk space. The disadvantage is that the system can let you start an application when there isn't enough real swap space available for it to run.

    For example, you may have 40 MB of real (logical) swap space and 40 MB of virtual swap space. The system considers your total swap space to be 80 MB. You start app1, which requests 30 MB but uses only 15 MB; then you start app2, which requests 40 MB but uses only 20 MB. Your system runs correctly because app1 and app2 are using a total of 35 MB of logical swap space, even though they requested a total of 70 MB.

    Now you perform a memory-intensive operation in app1, and it needs its maximum amount of swap space (30 MB). Your system cannot complete the operation because app1 needs 30 MB and app2 needs 20 MB of real swap space (50 MB total), and the system actually has only 40 MB of real swap space available. In this case, the system runs out of real swap space, it arbitrarily stops an application or UNIX process from running, and you may lose data.

    To add virtual swap space, see “Adding Virtual Swap Space”.

Swap Manager

The Swap Manager lets you view information about existing swap on your system and provides access to the swap guides.


Note: You must be familiar with the terms and concepts of swap space use in order to understand the information in the Swap Manager window. If you are unfamiliar with swap space, see “Understanding Swap Space”.

To open the Swap Manager, choose “System Manager” from the System toolchest (if it's not already running). Select the System Performance category and click the Swap Manager.

The Swap Manager window displays the following information about a particular swap space entry:

  • Location shows the pathname of the swap file.

  • Priority shows the priority; the system uses the swap space that has the highest priority (lowest number in this column) first. The default swap file, /dev/swap, always has highest priority.

  • Physical shows whether the swap space is logical or virtual; if it's logical swap space, the size of the swap file is shown here. If it's virtual swap space, this column contains zeros.

  • Virtual shows whether the swap space is logical or virtual; if it's logical swap space, this column contains zeros. If it's virtual swap space, the size that the system believes the swap file to be is shown here (even though the actual file is empty).

  • Free shows the amount of the total space of each swap area that's available for use.

You can use the Get Info button to display detailed information about a swap entry. Select a swap entry in the Swap Manager window and click Get Info. A Swap Panel window appears and displays information about the selected entry. (You can also double-click a swap entry to open its panel window.)

For further information on the Swap Manager, see “Swap Manager Reference”, which contains details on the Swap Manager graphical interface.

Swap Manager Reference

The Task menu contains these choices:

  • “Add Swap” opens the “Add Real Swap Space” guide, which lets you create real (logical) swap space on your system. This command is equivalent to the Add button. See “Adding Real Swap Space” for more information.

  • “Add Virtual Swap” opens the “Add Virtual Swap Space” guide, which lets you create virtual swap space on your system. See “Adding Virtual Swap Space” for more information.

  • “Remove a Swap Entry” opens the “Delete an Element of Swap Space” guide, which lets you remove either virtual or real swap space from your system. This command is equivalent to the Remove button. See “Removing Swap Space” for more information.

  • “System Manager” opens the System Manager window, which gives you access to all of the system administration interactive guides.

  • “Close” closes the Swap Manager window. Any changes you made using the guides are saved. This command is equivalent to the Close button.

The Help menu contains a list of help topics. To view a topic, choose it from that menu.

Adding Real Swap Space

When you add real (logical) swap space, you increase the amount of real swap space available to your system by the size of the swap file. For example, when you add 50 MB of swap space, a 50 MB file is created for the system to use as swap space. At the same time, the amount of disk space available for data storage is reduced by the size of the file. For more information, see “Understanding Swap Space”.

To add real swap space, open the System Manager if it isn't already open. Select the System Performance category and then click “Add Real Swap Space.” The guide takes you through the necessary steps.

Adding Virtual Swap Space

When you add virtual swap space, you create a file that the system considers to be a certain size (for example, 40 MB) but actually occupies a very small amount of disk space. In this way, you virtually increase the amount of available swap space. This lets you run more applications at the same time, but may cause you to run out of logical swap space and potentially lose data. For more information, see “Understanding Swap Space”.

To add virtual swap space, open the System Manager if it isn't already open. Select the System Performance category and then click “Add Virtual Swap Space.” The guide takes you through the necessary steps.

Removing Swap Space

You can use the “Remove Swap Space” guide to delete virtual swap space and logical swap space that you created using the Swap Manager. When you delete logical swap space (a swap file), you regain disk space; for example, when you delete 40 MB of logical swap space, you regain 40 MB of disk space. You cannot use the Swap Manager to delete the default logical swap space (the /dev/swap file) or to delete the virtual swap space created with the chkconfig command (/.swap.virtual).

If the System Manager is not already running, start it by choosing “System Manager” from the System toolchest. Select the System Performance category and then click “Remove Swap Space.” The guide takes you through the necessary steps.

You can also access the guide by selecting a swap entry in the Swap Manager window and clicking the Remove button.

Viewing Current System Activity

IRIX is a multi tasking operating system. This means that your system can perform many operations simultaneously. For example, you can run an application, print a file, and read your mail at the same time, without having to wait for each operation to complete before beginning the next one.

Every program that you run on the system is assigned a process ID that allows IRIX to keep track of what it is doing. By identifying the process numbers assigned to tasks, you can manage your operations more effectively.

When you are working at your system, the IRIX process that you are currently working with, either from the keyboard or with the mouse, is known as the foreground process. Any other IRIX processes running on the system are known as background processes. (For a detailed explanation of IRIX processes, see “About IRIX Processes”.)

Click on one of the links below for more information on that topic:

Process Manager

The Process Manager lets you view and manipulate processes on your system.

To open the Process Manager, choose “Process Manager” from the System Performance category of the System Manager.

The Process Manager window displays the following information about a particular process entry:

  • Process shows the name of the process.

  • User shows the user who owns the process.

  • Physical Mem shows how much physical memory (RAM) the process is using.

  • Start Date shows the date on which the process was initiated.

Choose a process by clicking its icon in the list. You can also sweep-select multiple processes by clicking the left mouse button and dragging across multiple icons in the list. If you select multiple processes and choose Terminate, all the processes that you have permission to modify are terminated. (User guest cannot modify a process owned by root, for example.)

For further information on the Process Manager, see “Process Manager Reference”, which contains details on the Process Manager graphical interface. For a more detailed explanation of UNIX processes, see “About IRIX Processes”.

About IRIX Processes

A program is a disk file that contains machine instructions. When you run (or launch) a program, your system reads those instructions from the file and performs the requested operations.

A running program is called a process. For example, if you launch the file editor jot, your system creates a process called jot that displays a window on the screen and responds to keyboard and mouse commands. You can launch jot a second time to edit a second file, and in that case you have two jot processes on the system.

An application is simply a program or group of programs that serve a specific purpose. Applications are normally programs that are used directly by an end-user and often have graphical user interfaces. An application may run as a single process on your system or may run as a group of processes on one or many systems. Examples of applications include file editors (jot, nedit), Internet browsers (Netscape Navigator, Internet Explorer), and design tools (Adobe Photoshop, and so on).

Some processes are never directly visible to the user (in other words, they do not display windows on the desktop) but run automatically behind the scenes to provide important system services. For example, one process that is always running on your system is called FAM, or File Alteration Monitor. This process responds to requests from other programs or applications that want to know if a file on the system has changed. When none of your applications is monitoring files, FAM stays in an idle or sleep state waiting for requests.

Process Manager allows you to view and modify the set of processes that is running on your system. For example, if your system seems sluggish, you can use the process manager to see what is running. On occasion, you'll find that a process has become “stuck” and needs to be terminated.

Process Manager Reference

The Process Manager contains the following items:

Task Menu 

“Terminate Process” cancels the selected process and removes it from the list (before canceling a process, be sure to save any data associated with that process' application, or you may lose that data); “System Manager” launches the System Manager system administration tool (see “Overview of the System Manager” in Chapter 1); “Close” closes the Process Manager window.

Process List 

Displays the processes you selected. You can choose to display all processes, the processes with a particular name (enter the process name in the Process Name Search text field) or the processes owned by a particular user (enter a user's name the User Name Search text field).

View All button 

Allows you to view either all processes, or just the processes with a particular name (defined in the Process Name Search text field) or those owned by a particular user (defined in the User Name Search text field).

Process Name Search text field 

Allows you to select all the processes with a particular name. Enter the name of the process in the text field and press Enter.

User Name Search text field 

Allows you to select all the processes owned by a particular user. You can either enter the name of the user, or use the User Name select button (the button with the downward-pointing arrow), and then press Enter.

Action Buttons 

The Terminate... button cancels the selected process and removes it from the list (before canceling a process, be sure to save any data associated with that process' application, or you may lose that data); the Get Info... button launches the Process Status Panel (see “Process Status Panel Reference”); the Close button closes the Process Manager window.

Process Status Panel Reference

The Process Status Panel contains the following items:

Task Menu 

“System Manager” launches the System Manager system administration tool (see “Overview of the System Manager” in Chapter 1); “Close” closes the Process Status Panel window.

Process Information 

The panel displays an icon for the process, the name of the process, its user, the amount of physical memory (RAM) the process is using, and the command that was issued to initiate the process.

Action Buttons 

The Process Manager button launches the Process Manager; the Close button closes the Process Status Panel window.

Viewing Memory Usage

The View Memory Usage selection in the System Manager System Performance category launches the gmemusage application. gmemusage is a graphical memory usage viewer that displays a vertical, colored bar chart that displays how your local memory (RAM) is being allocated. Each colored bar is labeled with the name of the program using the memory and the number of kilobytes of memory used. If more than one copy of a program is running, the number of copies is displayed in parentheses after the program name.

gmemusage also displays a breakdown of the regions within a program. Click on a bar or program name to replace the main view with a new chart of memory regions specific to that program. If gmemusage is unable to determine the base name of the file or device for a region that corresponds to a file or device, it displays the inode number of the file or device. To return to the default view, just click above the colored bar.

For further information, see the gmemusage(1) reference (man) page.

Viewing System Resources

The View System Resources selection in the System Manager System Performance category launches the gr_osview application, a real-time, graphical display of how your system resources are being used. The resources displayed are CPU usage, memory, CPU wait time (if any), and key system and graphics activity.

Next to the header for each resource displayed is a key that tells you which color is being used for a particular portion of the resource. For example, the CPU Usage band displays idle CPU time in green, user time in blue, system time in red, and so on.

For further information, see the gr_osview command.

Viewing CPU Usage

The View CPU Usage selection in the System Manager System Performance category launches the gr_top application. This command displays a sorted list of processes that are using some portion of the available CPU cycles on your system. The display is updated every five seconds.

The following fields are displayed in order for each process: process ID, process group ID, user name, process priority, process size (in pages), resident set size (in pages), process state, total amount of CPU time used by the process, the weighted CPUpercentage, CPU usage as a percentage, and the process name.

The View CPU Usage window displays the following information:

  • The first line in the window lists the system name, the release and build date information for the operating system currently running, the processor type, the load averages (the average number of jobs in the run queue over the last 1, 5 and 15 minutes), and the current time.

  • The second line displays the number of sleeping, stopped, and running processes.

  • The third line displays information about the number of CPUs.

  • The fourth line displays the maximum amount of memory on the system, the available memory, free memory, swap space used, and swap space available.

  • At the bottom, detailed data is displayed about each process, including the user who started the process, the process ID number (PID), and so on.

For additional information, see the gr_top(1) and top(1) reference (man) pages.

Managing Processes From the Command Line

For more information on displaying and manipulating processes from the command line, click on one of the following links:

Monitoring Processes

While many of the processes you are performing may be readily identifiable from your desktop, many others, including printing and some complex graphics operations, may be hidden from you. The easiest way to monitor processes is to use the Process Manager, available through the System Manager. See “Process Manager” for more information.

To monitor processes from the command line, you can enter the IRIX ps (processor status) command in an IRIX shell.

To monitor processes, follow these steps:

  1. Choose “Open Unix Shell” from the Desktop toolchest.

  2. Position your cursor within the shell window and type

    ps -a

    Then press Enter.

    When you enter the ps -a command, IRIX lists a process ID number (PID), a terminal ID (TTY), time, and name of each process that you started on your system; it does not show all running processes. For example:

    PID     TTY    TIME    COMMAND
    7662    ttyq1  4:54    csh
    7668    ttyq1  15:04   ps
    7670    ttyq1  15:14   cedit
    

    To check all running processes for a specific process, such as dmb, type

    ps -ef | grep dmb

    Additional parameters in the ps command line provide more comprehensive listings. For more information on the command, see the ps(1) reference (man) page.

Stopping Processes

Occasionally you may want to stop a process—for example, a PostScript printing process that measurably slows down system operations. In many cases, you can use an application command to stop a process from the desktop. But in some instances, you must stop the process from the shell by using the kill command. A non-privileged user can use the command to kill only his or her own processes; the Administrator can stop any process running on the system.


Note: If a system process is stopped by the Administrator, the termination may cause the system to hang or crash. Always save your current work before stopping a system process as the Administrator.

To stop a process, follow these steps:

  1. Choose “Open Unix Shell” from the Desktop toolchest.

    To stop a process started by the Administrator, or to stop processes started by several different users, log in as root by typing

    login root

    Then press Enter.

    If a prompt for a password appears, type the password, then press Enter. If a prompt appears but the root account has no password, just press Enter.

  2. Position your cursor within the new window and type

    ps -ef

    Then press Enter.

    The listing provides a full listing, including the process ID (PID), of all processes that are currently running. Find the one that you want to terminate.

  3. Use the kill command with the PID as the parameter. For example, to kill process number 754, type:

    kill 754

    Then press Enter.

    Additional parameters in the kill command line provide variations on process terminations. For example, the command kill -9 is a “sure-kill,” stopping almost any type of process. For more information on the kill command, see the kill(1) reference (man) page.

Viewing Previous System Activity

Your system monitors and saves information about its activity in log files. To perform maintenance or get information on past system conditions, you may want to access this information.

Click on one of the links below for more information on that topic:

Viewing the System Log

The System Monitor keeps track of system activity in the file /var/sysadm/salog, and displays this information in the System Log Viewer. There are four types of tracking messages:

  • Critical messages report problems that keep you from using the system; a red exclamation mark appears next to these messages.

  • Error messages report system errors that do not keep you from using the system—often these errors occurred on system startup; an orange circle with a slash through it appears next to these messages.

  • Warning messages report conditions that may soon cause a critical problem or a system error; a yellow exclamation mark appears next to these messages.

  • Informational messages report status information; a blue “I” appears next to these messages.

If detailed help is available on a message, a white help balloon appears next to the message. To view this help, double-click the message.

The System Log Viewer includes these menus:

  • The File menu lets you open, print, or save specific messages.

  • The View menu changes the amount of information that the System Log Viewer displays about each message stored in the /var/adm/SYSLOG file. The menu items are as follows:

    “Frequency” 

    Displays the Freq column; it shows how many times the message appears.

    “Hostname” 

    Displays the Hostname column, which shows the name of the system from which the message came.

    “Date/Time” 

    Displays the Date and Time columns, which show the most recent occurrence of a message.

    “Source” 

    Displays the Source column, which shows which system process sent the message.

  • The Filter menu changes the type of messages that the System Log Viewer displays in the /var/adm/SYSLOG file. The menu items are as follows:

    “Critical” 

    Shows messages that report problems that keep you from using the system.

    “Error” 

    Shows messages that report problems that may keep you from using the system.

    “Warning” 

    Shows messages that report conditions that may soon cause a critical problem or a system error.

    “Info” 

    Shows messages that report status information.

    The Filter menu also contains “Remove Duplicates,” which guarantees that you see only one instance of a particular message if multiple messages came in at the same time.

  • The Help menu displays online information about how to use the System Monitor and System Log Viewer. See the sysmon(1M) reference (man) page for more information.

Printing or Saving System Log Messages

To print the currently displayed messages, choose File > Print. Click Print in the print dialog that appears.

To print the currently displayed messages to a file, choose File > Save As. Enter a full pathname for the file in the window that appears, then click OK.

View the System Administration Log

The system administration log information is stored in the /var/adm/SYSLOG file. You can view this information by selecting System Manager > System Performance > View the System Administration Log in your Desktop toolchest.

The system administration log viewer has a display area listing the contents of the log file. The Options button at the bottom of the panel launches the Set System Administration Log Options task. See “Set System Administration Log Options” for details.

For further information, see the viewlog(1) reference (man) page.

Set System Administration Log Options

The system administration log, /var/sysadm/salog, contains a record of the privileged commands that are run on your system. This log file is created by the runpriv command. To display this log, see “View the System Administration Log”.

For further information, see the viewlog(1) reference (man) page.