TOP(1) Linux User s Manual TOP(1)



Similar documents
The System Monitor Handbook. Chris Schlaeger John Tapsell Chris Schlaeger Tobias Koenig

System Resources. To keep your system in optimum shape, you need to be CHAPTER 16. System-Monitoring Tools IN THIS CHAPTER. Console-Based Monitoring

This presentation explains how to monitor memory consumption of DataStage processes during run time.

CPSC 2800 Linux Hands-on Lab #7 on Linux Utilities. Project 7-1

University of Pennsylvania Department of Electrical and Systems Engineering Digital Audio Basics

Facultat d'informàtica de Barcelona Univ. Politècnica de Catalunya. Administració de Sistemes Operatius. System monitoring

CIT 470: Advanced Network and System Administration. Topics. Performance Monitoring. Performance Monitoring

Using esxtop to Troubleshoot Performance Problems

System Administration

Operating System and Process Monitoring Tools

These sub-systems are all highly dependent on each other. Any one of them with high utilization can easily cause problems in the other.

IBM Tivoli Monitoring Version 6.3 Fix Pack 2. Infrastructure Management Dashboards for Servers Reference

Performance monitoring. in the GNU/Linux environment. Linux is like a wigwam - no Windows, no Gates, Apache inside!

Setting up PostgreSQL

Operating Systems. Design and Implementation. Andrew S. Tanenbaum Melanie Rieback Arno Bakker. Vrije Universiteit Amsterdam

Outline. Operating Systems Design and Implementation. Chap 1 - Overview. What is an OS? 28/10/2014. Introduction

SLURM Resources isolation through cgroups. Yiannis Georgiou Matthieu Hautreux

Partitioning. Files on the Hard Drive. Administration of Operating Systems DO2003. Partition = Binder with index. Write file = Insert document

OS Thread Monitoring for DB2 Server

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Quick Tutorial for Portable Batch System (PBS)

Distributed Computing under Linux

White Paper. Real-time Capabilities for Linux SGI REACT Real-Time for Linux

Determining the Correct Usage of Swap in Linux * 2.6 Kernels

Optimizing Linux Performance

Overlapping Data Transfer With Application Execution on Clusters

Hands-On UNIX Exercise:

Laboratory Report. An Appendix to SELinux & grsecurity: A Side-by-Side Comparison of Mandatory Access Control & Access Control List Implementations

An Implementation Of Multiprocessor Linux

Application Monitor Application (APPMON)

CIT 668: System Architecture. Performance Testing

CS420: Operating Systems OS Services & System Calls

Thirty Useful Unix Commands

Process Scheduling in Linux

Perf Tool: Performance Analysis Tool for Linux

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Linux Tools for Monitoring and Performance. Khalid Baheyeldin November 2009 KWLUG

Jorix kernel: real-time scheduling

Introduction to the SGE/OGS batch-queuing system

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Virtual Private Systems for FreeBSD

Expert Reference Series of White Papers. Performance and Troubleshooting with esxtop

Leak Check Version 2.1 for Linux TM

Testing for Security

SIDN Server Measurements

ELEC 377. Operating Systems. Week 1 Class 3

Extreme Linux Performance Monitoring Part II

Oracle Enterprise Manager

WINDOWS PROCESSES AND SERVICES

Introduction. What is an Operating System?

Introduction. How does FTP work?

CS3600 SYSTEMS AND NETWORKS

Release February 2005

Communication Protocol

Audit Trail Administration

UNIX Comes to the Rescue: A Comparison between UNIX SAS and PC SAS

Database Studio is the new tool to administrate SAP MaxDB database instances as of version 7.5.

An Introduction to High Performance Computing in the Department

G14 Unix Tools and Scripts to Monitor and Tune your Informix IDS Server

Chapter 2 System Structures

Server Management Tools (ASMT)

Process definition Concurrency Process status Process attributes PROCESES 1.3

Example of Standard API

SAS Application Performance Monitoring for UNIX

CSI 402 Lecture 13 (Unix Process Related System Calls) 13 1 / 17

VIRTUALIZATION AND CPU WAIT TIMES IN A LINUX GUEST ENVIRONMENT

USEFUL UNIX COMMANDS

System Security Fundamentals

RTI Database Integration Service. Release Notes

Software Tracing of Embedded Linux Systems using LTTng and Tracealyzer. Dr. Johan Kraft, Percepio AB

Unix::Statgrab - System Monitoring

PHP Debugging. Draft: March 19, Christopher Vickery

NetBeans Profiler is an

Limiting PostgreSQL resource consumption using the Linux kernel

Using Big Datasets in Stata

Process Scheduling in Linux

Monitoring Linux with native tools

Table of Contents. The RCS MINI HOWTO

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

HyperThreading Support in VMware ESX Server 2.1

Port Scanning. Objectives. Introduction: Port Scanning. 1. Introduce the techniques of port scanning. 2. Use port scanning audit tools such as Nmap.

Best Practices on monitoring Solaris Global/Local Zones using IBM Tivoli Monitoring

System performance monitoring in RTMT

Kernel comparison of OpenSolaris, Windows Vista and. Linux 2.6

CS10110 Introduction to personal computer equipment

SD Call Recorder and Desktop Software Reference Guide Version 2.0

CPE453 Laboratory Assignment #2 The CPE453 Monitor

NetApp Storage System Plug-In for Oracle Enterprise Manager 12c Installation and Administration Guide

20 Command Line Tools to Monitor Linux Performance

Using Process Monitor

Gigabit Ethernet Packet Capture. User s Guide

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

An Introduction to SAS/SHARE, By Example

Real-Time Scheduling 1 / 39

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Miami University RedHawk Cluster Working with batch jobs on the Cluster

Transcription:

NAME top display top CPU processes SYNOPSIS top [ ] [ddelay] [ppid] [q][c][c][s][s][i][niter] [b] DESCRIPTION top provides an ongoing look at processor activity in real time. It displays a listing of the most CPU-intensive tasks on the system, and can provide an interactive interface for manipulating processes. It can sort the tasks by CPU usage, memory usage and runtime. can be better configured than the standard top from the procps suite. Most features can either be selected by an interactive command or by specifying the feature in the personal or system-wide configuration file. See below for more information. COMMAND LINE OPTIONS d Specifies the delay between screen updates. Youcan change this with the s interactive command. p q S s i C c n b Monitor only processes with given process id. This flag can be given up to twenty times. This option is neither available interactively nor can it be put into the configuration file. This causes top to refresh without any delay. If the caller has superuser priviledges, top runs with the highest possible priority. Specifies cumulative mode, where each process is listed with the CPU time that it as well as its dead children has spent. This is like the -S flag to ps(1). See the discussion below of the S interactive command. Tells top to run in secure mode. This disables the potentially dangerous of the interactive commands (see below). A secure top is a nifty thing to leave running on a spare terminal. Start top ignoring any idle or zombie processes. See the interactive command i below. display total CPU states in addition to individual CPUs. This option only affects SMP systems. display command line instead of the command name only. The default behaviour has been changed as this seems to be more useful. Number of iterations. Update the display this number of times and then exit. Batch mode. Useful for sending output from top to other programs or to a file. In this mode, top will not accept command line input. It runs until it produces the number of iterations requested with the n option or until killed. Output is plain text suitable for display on a dumb terminal. FIELD DESCRIPTIONS top displays a variety of information about the processor state. The display is updated every 5 seconds by default, but you can change that with the d command-line option or the s interactive command. uptime This line displays the time the system has been up, and the three load averages for the system. The load averages are the average number of process ready to run during the last 1, 5 and 15 minutes. This line is just like the output of uptime(1). The uptime display may be toggled by the interactive l command. processes The total number of processes running at the time of the last update. This is also broken down into the number of tasks which are running, sleeping, stopped, or undead. The processes and states display may be toggled by the t interactive command. CPU states Shows the percentage of CPU time in user mode, system mode, niced tasks, and idle. (Niced tasks are only those whose nice value is negative.) Time spent in niced tasks will also be counted in system and user time, so the total will be more than 100%. The processes and states display may be toggled by the t interactive command. Mem Statistics on memory usage, including total available memory, free memory, used memory, shared memory, and memory used for buffers. The display of memory information may be toggled by the Linux Feb 11993 1

Swap PID PPID UID USER PRI NI SIZE m interactive command. Statistics on swap space, including total swap space, available swap space, and used swap space. This and Mem are just like the output of free(1). The process ID of each task. The parent process ID each task. The user ID of the task s owner. The user name of the task s owner. The priority of the task. The nice value of the task. Negative nice values are higher priority. The size of the task s code plus data plus stack space, in kilobytes, is shown here. TSIZE The code size of the task. This gives strange values for kernel processes and is broken for ELF processes. DSIZE Data + Stack size. This is broken for ELF processes. TRS SWAP D LC RSS Te xtresident size. Size of the swapped out part of the task. Size of pages marked dirty. Last used processor. (That this changes from time to time is not a bug; Linux intentionally uses weak affinity. Also notice that the very act of running top may break weak affinity and cause more processes to change current CPU more often because of the extra demand for CPU time.) The total amount of physical memory used by the task, in kilobytes, is shown here. For ELF processes used library pages are counted here, for a.out processes not. SHARE The amount of shared memory used by the task is shown in this column. STAT The state of the task is shown here. The state is either S for sleeping, D for uninterruptible sleep, R for running, Z for zombies, or T for stopped or traced. These states are modified by trailing < for a process with negative nice value, N for a process with positive nice value, W for a swapped out process (this does not work correctly for kernel processes). WCHAN depending on the availablity of either /boot/psdatabase or the kernel link map /boot/system.map this shows the address or the name of the kernel function the task currently is sleeping in. TIME Total CPU time the task has used since it started. If cumulative mode is on, this also includes the CPU time used by the process s children which have died. You can set cumulative mode with the S command line option or toggle it with the interactive command S. The header line will then be changed to CTIME. %CPU The task s share of the CPU time since the last screen update, expressed as a percentage of total CPU time per processor. %MEM The task s share of the physical memory. COMMAND The task s command name, which will be truncated if it is too long to be displayed on one line. Tasks in memory will have a full command line, but swapped-out tasks will only have the name of the program in parentheses (for example, "(getty)"). A,WP these fields from the kmem top are not supported. Linux Feb 11993 2

INTERACTIVE COMMANDS Several single-key commands are recognized while top is running. Some are disabled if the s option has been given onthe command line. space ˆL h or? k i I n or # q r S s f or F o or O l m t c N A P M T W Immediately updates the display. Erases and redraws the screen. Displays a help screen giving a brief summary of commands, and the status of secure and cumulative modes. Kill a process. Youwill be prompted for the PID of the task, and the signal to send to it. For a normal kill, send signal 15. For a sure, but rather abrupt, kill, send signal 9. The default signal, as with kill(1), is 15, SIGTERM. This command is not available in secure mode. Ignore idle and zombie processes. This is a toggle switch. Toggle between Solaris (CPU percentage divided by total number of CPUs) and Irix (CPU percentage calculated solely by amount of time) views. This is a toggle switch that affects only SMP systems. Change the number of processes to show. You will be prompted to enter the number. This overrides automatic determination of the number of processes to show, which is based on window size measurement. If 0 is specified, then top will show as many processes as will fit on the screen; this is the default. Quit. Re-nice a process. Youwill be prompted for the PID of the task, and the value to nice it to. Entering a positve value will cause a process to be niced to negative values, and lose priority. Ifroot is running top, a neg ative value can be entered, causing a process to get a higher than normal priority. The default renice value is 10. This command is not available in secure mode. This toggles cumulative mode, the equivalent of ps -S, i.e., that CPU times will include a process s defunct children. For some programs, such as compilers, which work by forking into many seperate tasks, normal mode will make them appear less demanding than they actually are. For others, however, such as shells and init, this behavior is correct. In any case, try cumulative mode for an alternative view ofcpu use. Change the delay between updates. You will be prompted to enter the delay time, in seconds, between updates. Fractional values are recognized down to microseconds. Entering 0 causes continuous updates. The default value is 5 seconds. Note that low values cause nearly unreadably fast displays, and greatly raise the load. This command is not available in secure mode. Add fields to display or remove fields from the display. See below for more information. Change order of displayed fields. See below for more information. toggle display of load average and uptime information. toggle display of memory information. toggle display of processes and CPU states information. toggle display of command name or full command line. sort tasks by pid (numerically). sort tasks by age (newest first). sort tasks by CPU usage (default). sort tasks by resident memory usage. sort tasks by time / cumulative time. Write current setup to /.toprc. This is the recommended way to write a top configuration file. Linux Feb 11993 3

The Field and Order Screens After pressing f, F, o or O you will be shown a screen specifying the field order on the top line and short descriptions of the field contents. The field order string uses the following syntax: If the letter in the filed string corresponding to a field is upper case, the field will be displayed. This is furthermore indicated by an asterisk in front of the field description. The order of the fields corresponds to the order of the letters in the string. From the field select screen you can toggle the display of a field by pressing the corresponding letter. From the order screen you may move a field to the left by pressing the corresponding upper case letter resp. to the right by pressing the lower case one. Configuration Files Topreads it s default configuration from two files, /etc/toprc and /.toprc. The global configuration file may be used to restrict the usage of top to the secure mode for non-priviledged users. If this is desired, the file should contain a s to specify secure mode and a digit d (2<=d<=9) for the default delay (in seconds) on a single line. The personal configuration file contains two lines. The first line contains lower and upper letters to specify which fields in what order are to be displayed. The letters correspond to the letters in the Fields or Order screens from top. As this is not very instructive, itisrecommended to select fields and order in a running top process and to save this using the W interactive command. The second line is more interesting (and important). It contains information on the other options. Most important, if you have saved a configuration in secure mode, you will not get an insecure top without removing the lower s from the second line of your /.toprc. A digit specifies the delay time between updates, a capital S cumulative mode, a lower i no-idle mode, a capital I Irix view. Asininteractive mode, a lower m, l, and t suppresses the display of memory, uptime resp. process and CPU state information. Currently changing the default sorting order (by CPU usage) is not supported. NOTES This proc-based top works by reading the files in the proc filesystem, mounted on /proc. If /proc is not mounted, top will not work. %CPU shows the cputime/realtime percentage in the period of time between updates. For the first update, ashort delay is used, and top itself dominates the CPU usage. After that, top will drop back, and a more reliable estimate of CPU usage is available. The SIZE and RSS fields don t count the page tables and the task_struct of a process; this is at least 12K of memory that is always resident. SIZE is the virtual size of the process (code+data+stack). Keep in mind that a process must die for its time to be recorded on its parent by cumulative mode. Perhaps more useful behavior would be to follow each process upwards, adding time, but that would be more expensive, possibly prohibitively so. In any case, that would make top s behavior incompatible with ps. FILES /etc/toprc The global configuration file. /.toprc The personal configuration file. SEE ALSO ps(1), free(1), uptime(1), kill(1), renice(1). BUGS If the window isless than about 70x7, top will not format information correctly. Many fields still have problems with ELF processes. the help screens are not yet optimized for windows with less than 25 lines AUTHOR top was originally written by Roger Binns, based on Branko Lankester s <lankeste@fwi.uva.nl> ps program. Robert Nation <nation@rocket.sanders.lockheed.com> re-wrote it significantly to use the proc filesystem, based on Michael K. Johnson s <johnsonm@redhat.com> proc-based ps program. Michael Shields <mjshield@nyx.cs.du.edu> made many changes, including secure and cumulative modes and a general cleanup. Tim Janik <timj@gtk.org> added age sorting and the ability to monitor specific processes through their ids. Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Heavily changed it to include support for Linux Feb 11993 4

configurable fields and other new options, and did further cleanup and use of the new readproc interface. The "b" and "n" options contributed by George Bonser <george@captech.com> for CapTech IT Services. Michael K. Johnson <johnsonm@redhat.com> is now the maintainer. Please send bug reports to <procps-bugs@redhat.com> Linux Feb 11993 5