Using netstat for Performance Analysis

Slides:



Advertisements
Similar presentations
Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.
Advertisements

Categories of I/O Devices
Operating System.
Computer System Organization Computer-system operation – One or more CPUs, device controllers connect through common bus providing access to shared memory.
CHAPTER 2 PROCESSOR SCHEDULING PART I By U ğ ur HALICI.
The Components There are three main components of inDepth Lite, inDepth and inDepth+ Real Time Component Reporting Package Configuration Tools.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
DIRECT MEMORY ACCESS CS 147 Thursday July 5,2001 SEEMA RAI.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
OS Spring’03 Introduction Operating Systems Spring 2003.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Measuring Performance Chapter 12 CSE807. Performance Measurement To assist in guaranteeing Service Level Agreements For capacity planning For troubleshooting.
Computer Organization and Architecture
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 14 Server and Network Monitoring.
OS and the Computer System  Some OS programs exist permanently in the system area of the memory to monitor and control activities in the computer system.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
With Microsoft Windows 7© 2012 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Windows 7.
CE Operating Systems Lecture 5 Processes. Overview of lecture In this lecture we will be looking at What is a process? Structure of a process Process.
Offline Performance Monitoring for Linux Abhishek Shukla.
MCTS Guide to Microsoft Windows 7
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Performance Monitoring.
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Performance Monitoring.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems CSCI-6140 – Computer Operating Systems David Goldschmidt, Ph.D.
Lecture 2 Process Concepts, Performance Measures and Evaluation Techniques.
*** CONFIDENTIAL *** © Toshiba Corporation 2008 Confidential Creating Report Templates.
Guide to Linux Installation and Administration, 2e1 Chapter 10 Managing System Resources.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Operating Systems Process Management.
Lecture – Performance Performance management on UNIX.
Cosc 4750 Maintenance & Analysis. Maintenance Contracts Annual cost of 10%-12% of component’s list price. On-site maintenance –usually within hours.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Computer Systems Week 14: Memory Management Amanda Oddie.
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:
CS 390 Unix Programming Environment
Page 1 Monitoring, Optimization, and Troubleshooting Lecture 10 Hassan Shuja 11/30/2004.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Guide to Parallel Operating Systems with Windows 7 and Linux Chapter 10 Operating System Management.
1 load [2], [9] Transfer contents of memory location 9 to memory location 2. Illegal instruction.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Linux Command Tips.
Memory Management.
Chapter 2 Memory and process management
Linux203Training Module System Mgmt.
Process Management Process Concept Why only the global variables?
MCTS Guide to Microsoft Windows 7
Chapter 2: System Structures
Introduction of microprocessor
Operating Systems CPU Scheduling.
Processor Management Damian Gordon.
CS703 - Advanced Operating Systems
Lecture Topics: 11/1 General Operating System Concepts Processes
Troubleshooting Techniques(*)
Chapter 2: Operating-System Structures
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 3: Processes Process Concept Process Scheduling
Chapter 2: Operating-System Structures
Processor Management Damian Gordon.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Using netstat for Performance Analysis Zack Hoffmann

Network vs. Individual System Performance This system could contain a number of networked subsystems! System Completions Arrivals

Here we have a basic system containing networked subsystems. System A Aa Ca Ab System B Cb Cn An Ac Cc System C A switching or broadcasting device Now, in addition to worrying about individual system performance, we have to worry about network performance!

Tracking Network Traffic In individual systems we track the progress of jobs, from their arrival to their completion, to determine performance. In a network we can not do this. Entire jobs are not moved in and out of systems on a network. Instead, packets of information pass through those systems. We can monitor these packets to analyze performance.

Introducing netstat

About netstat Netstat has options for viewing your network data in many different formats. Some used to measure throughput. Others used to diagnose network problems. Many may require a deeper level of network hardware knowledge than is applicable to this course.

netstat -i 1 Shows incoming and outgoing packet counts and sizes every second. What we’re looking for here are errors (errs) from either output or input. You won’t have to worry about collisions unless you’re using a hub-based network, but if you are then they can be significant.

netstat -i Can be run without time interval for a more comprehensive history (since last system boot). Useful benchmarks for analysis using netstat –i: (Coll+Ierrs+Oerrs)/(Ipkts+Opkts) > 2% This could indicate problems in your network hardware. (Coll/Opkts) > 10% Your hub network should be segmented with additional switches. (Ierrs/Ipkts) > 25% Your system or network may be overloaded.

netstat -a Lists all active connections But as you can imagine, our fang machine has a ton of them, so I’ll specify –pTCP to limit it to TCP connections. This indicates that the receiving system can not get these packets fast enough. This is a problem with the network (either yours or theirs) and NOT your system. (However, sending queues with sizes this small are typical.) Keep an eye here, too. If a connection gets hung up in a waiting state, it may be a sign of problems in your protocol handling. Large, ongoing spikes here would indicate a bottleneck on your system, as this queue is for packets to be used by a job on this machine.

Deeper Analysis netstat -s spray Historical statistics, by protocol. Diagnose protocol handling/routing issues. spray Separate tool, sends bursts of meaningless packets. Great for determining levels of congestion. Send absurd amount of packets, see how many get dropped. Same technique can be used between two networked machines to determine if an issue is the product of congestion or due to a slow receiving machine.

Measuring Individual Throughput with netstat You could use netstat -i 1, pick an interval of time, and see how much data gets pushed out in that interval. However, packet input and output are not in a 1-to-1 correspondence like job acceptance and completion. If a remote system is uploading a large file to your system, your packets in will be vastly greater than your packets out!

Using “Goodput” Instead Goodput is simply throughput which takes in to account protocol overhead and retransmitted packets. It measures only bits useful on the application level. If you know how much data from each packet is NOT overhead, this is calculated the same as throughput by simply multiplying by the percentage of non-overhead bits afterwards. Must also remember to exclude retransmitted packets (netstat -s provides this information).

So What’s the Point? When you’re trying to estimate performance on a network level, you have to consider factors OUTSIDE of your system. netstat can tell you whether or not your poor performance is caused by network elements, and can give you some indication of how much it may be slowing you down.

System Performance using vmstat Adithya A Guruswamy

Synopsis Analyzing Performance . Why Analyze Performance ? Performance Analysis Commands. Virtual Memory. Vmstat. Determining CPU usage with vmstat. Graphical Representation of vmstat. Bibliography.

Analyzing Performance Performance Analysis is the Process of analyzing performance bottlenecks in the system. It Involves a number of steps : Identify the problem. Is the problem CPU oriented or I/O related ? CPU Problem - What is the Load Average ? I/O problem – is it paging or normal disk I/O?

Why Analyze Performance? To eliminate bottlenecks. To reduce the Resident Time. To increase the Throughput. Increase the overall efficiency of the system.

Performance Analysis Commands vmstat : VIRTUAL MEMORY STATISTICS. netstat : NETWORK STATISTICS. iostat : INPUT/OUTPUT STATISTICS

Virtual Memory Memory, often as simulated on a hard disk, that emulates RAM, allowing an application to operate as though the computer has more memory than it actually does.

                                                                                                                         Computer Hierarchy

vmstat vmstat (Virtual Memory STATistics) is a computer operating system monitoring tool that collects and displays summary information about memory, processes, interrupts, paging and block I/O information. Also vmstat command reports statistics about kernel threads, virtual memory, disks, traps and CPU activity. Reports generated by the vmstat command can be used to balance system load activity.

vmstat Syntax : vmstat [-a] [-n] [delay [ count]] vmstat [-f] [-s] [-m] vmstat [-S unit] vmstat [-d] vmstat [-p disk partition] vmstat [-V] -f Reports the number of forks since system startup. -i Displays the number of interrupts taken by each device since system startup. -s Display the contents of the sum structure, giving the total number of several kinds of paging related events which have occurred since system startup.

vmstat -a switch displays active/inactive memory . -m displays slab info. -n switch causes the header to be displayed only once rather than periodically. -d reports disk statistics . -p followed by some partition name for detailed statistics. -V switch results in displaying version information.

DETERMINING CPU USAGE WITH VMSTAT vmstat output

Description Procs Memory r: The number of processes waiting for run time. b: The number of processes in uninterruptible sleep. Memory swpd: The amount of virtual memory used. free: The amount of idle memory. buff: The amount of memory used as buffers. cache: The amount of memory used as cache. inact: The amount of inactive memory. (-a option) active: The amount of active memory. (-a option)

Description Swap IO System in: The number of interrupts per second. si: Amount of memory swapped in from disk (/s). so: Amount of memory swapped to disk (/s). IO bi: Blocks received from a block device (blocks/s). bo: Blocks sent to a block device (blocks/s). System in: The number of interrupts per second. cs: The number of context switches per second.

Description CPU These are percentages of total CPU time. us: Time spent running non-kernel code. sy: Time spent running kernel code. id: Time spent idle. wa: Time spent waiting for io. st: Time stolen from a virtual machine.

Graphical Representation vmstat – by day

Graphical Representation vmstat – by day

Graphical Representation vmstat - by week

Bibliography References obtained from : http://en.wikipedia.org/wiki/Main_Page http://www.redhat.com http://www.freebsd.org http://www.linuxcommand.org/man_pages/vmstat8.html http://www.linuxjournal.com

THE END THANK YOU

PERFORMANCE ANALYSIS using IOSTAT Chaitali Barve

What is Performance Analysis? Whenever CPU is occupied by a process, it is unavailable for processing other requests. This becomes a bottleneck in the system. To troubleshoot CPU performance finding CPU utilization is one of the important tasks.

iostat ‘iostat’ reports CPU statistics and Input/Output statistics for devices and partitions. The reports generated can be used to change system configuration to better balance the input/output load between physical disks. It can be used to find system’s average CPU utilization since the last reboot.

Syntax for ‘iostat’ Syntax is iostat <options> interval count options - Lets you specify the device for which information is needed like disk , cpu or terminal. (-d , -c , -t  or -tdc ). x options gives the extended statistics. Interval - It is time period in seconds between two samples. ‘iostat 4’ will give data at each 4 seconds interval. count  - It is the number of times the data is needed. ‘iostat 4 5’   will give data at 4 seconds interval 5 times.

Analyzing CPU Percentage of time that the CPU or CPUs were idle during which the system did not have outstanding request Percentage of CPU utilization Executing at the user level with nice priority. Percentage of time that the CPU or CPUs were idle during which the system had outstanding request Executing at the system level (kernel).

Report The report generated by the ‘iostat’ command is the CPU Utilization Report. The report consists of a ‘tty’ and CPU header row followed by a row of ‘tty’ and CPU statistics. Also, the I/O wait state is defined system-wide and not per processor.

Analyzing Disk number of transfers per second total number of blocks written amount of data read from the drive amount of data written to the drive total number of blocks read

Report The second report generated by the ‘iostat’ is the Disk Utilization Report. The device report provides statistics on a per physical device or partition basis.

Iostat Using Time Print the time for each report displayed

Report The first report contains statistics for the time since system start up (boot). Each subsequent report contains statistics collected during the interval since the previous report.

Command used to get 2 reports for disk utilization in interval of 2 seconds :- iostat –d 2 2

Putting it Together ‘iostat’ is basically used for CPU statistics & input/output statistics for devices and partitions. ‘iostat’ command can be specifically used to get reports either for CPU or for Input/Output. The time at which a certain was generated can also be captured. Thus, ‘iostat’ helps us to find out which process is using how much CPU or Input/Output. Likewise system configuration steps can be ammended to make necessary changes for CPU and Input/Output usage