Sei sulla pagina 1di 41

Performance in a Virtualized Environment

Module 4

2015 VMware Inc. All rights reserved.


You Are Here

1. Course Introduction 7. Storage Scalability

2. vSphere Security 8. Storage Optimization

3. VMware Management 9. CPU Optimization


Resources
10. Memory Optimization
4. Performance in a Virtualized
11. Virtual Machine and Cluster
Environment
Optimization
5. Network Scalability
12. Host and Management
6. Network Optimization Scalability

VMware vSphere: Optimize and Scale 4-2


2015 VMware Inc. All rights reserved.
Importance
Virtual machines and physical computers have many important
differences regarding performance. These differences include the
monitoring tools available and the overall performance troubleshooting
methodology.

VMware vSphere: Optimize and Scale 4-3


2015 VMware Inc. All rights reserved.
Module Lessons
Lesson 1: Performance Overview
Lesson 2: Monitoring Tools

VMware vSphere: Optimize and Scale 4-4


2015 VMware Inc. All rights reserved.
Lesson 1:
Performance Overview

4-5
2015 VMware Inc. All rights reserved.
Learner Objectives
By the end of this lesson, you should be able to meet the following
objectives:
Review components of the VMware ESXi architecture
Describe fundamentals of performance
Define a performance problem
Discuss the VMware vSphere performance troubleshooting methodology

VMware vSphere: Optimize and Scale 4-6


2015 VMware Inc. All rights reserved.
Virtualization Architectures
VMware offers two types of Hosted Architecture

virtualization architectures: hosted


and bare-metal.
VMware Workstation and
VMware Fusion use the hosted
architecture.
ESXi uses the bare-metal
Bare-Metal Architecture
(hypervisor) architecture.

VMware vSphere: Optimize and Scale 4-7


2015 VMware Inc. All rights reserved.
ESXi Architecture
ESXi is a platform for running
many virtual machines on a Guest File
physical host. TCP/IP System
Guest
The VMkernel (hypervisor)
runs a virtual machine monitor
(VMM) that is responsible for
Monitor Virtual Machine Monitor
the execution of the virtual
machine: Virtual NIC Virtual SCSI

CPU is controlled by the Scheduler


Memory
Allocator
Virtual Switch File System
scheduler and virtualized by
the VMM. NIC Drivers I/O Drivers
VMkernel
Memory is allocated by the
VMkernel and virtualized by
the VMM.
Network and storage I/O
Physical Host
devices are proxied through
native device drivers.

VMware vSphere: Optimize and Scale 4-8


2015 VMware Inc. All rights reserved.
Virtualization Performance: First Dimension
A virtualized environment has various factors
that affect performance.
Virtual Machine
These factors depend on the dimension of
virtualization. vCPU

The first dimension of virtualization is a single


virtual machine on a single physical host.
VMM
The hypervisor sits between the virtual machine
and the physical hardware. Hypervisor
A first-dimension factor that affects performance
is VMM overhead.
PCPU

Host

VMware vSphere: Optimize and Scale 4-9


2015 VMware Inc. All rights reserved.
Virtualization Performance: Second Dimension
The second dimension of virtualization is running multiple virtual
machines on a physical host.
Server consolidation is a main goal of virtualization. So your environment
is probably at the second dimension of virtualization.
Second-dimension factors that affect performance are scheduling
overhead and insufficient resources, such as network and storage
bandwidth.

Virtual Machine Virtual Machine Virtual Machine

Hypervisor

PCPU

Host

VMware vSphere: Optimize and Scale 4-10


2015 VMware Inc. All rights reserved.
Virtualization Performance: Third Dimension
The third dimension of virtualization is running multiple virtual machines
in a VMware vSphere Distributed Resource Scheduler cluster.
The third dimension reduces the impact of second-dimension
performance issues
A third-dimension factor that affects performance is aggressive VMware
vSphere vMotion migration.

Virtual Virtual Virtual Virtual Virtual Virtual


Machine Machine Machine Machine Machine Machine

Hypervisor Hypervisor
vSphere
Host vMotion Host

VMware vSphere: Optimize and Scale 4-11


2015 VMware Inc. All rights reserved.
Performance Factors in a vSphere Environment
The following factors can affect performance in a vSphere environment:
Overcommitment of hardware resources:
For example, an ESXi host is overloaded with more CPU-intensive virtual machines
than it can handle.
Inherent imbalances in the system:
For example, disks are much slower than CPU, so a disk-intensive application might
experience slower-than-expected performance.
Configuration issues or user errors:
For example, a user configures CPU shares at a level that is too restrictive.

VMware vSphere: Optimize and Scale 4-12


2015 VMware Inc. All rights reserved.
Best Practices for Performance
To get the best performance out of your vSphere environment, you
should follow these traditional best practices:
Understand and account for the target applications profile and workload
characteristics.
Optimally configure virtual machines.
Improve virtualization performance by using newer platforms when available.
Monitor consolidated workloads closely to discover new bottlenecks quickly.

VMware vSphere: Optimize and Scale 4-13


2015 VMware Inc. All rights reserved.
Performance Problems
Performance management refers to the process of establishing
performance requirements for applications, in the form of service-level
agreements (SLAs).
A performance problem is defined in the context of an ongoing
performance management and capacity planning process.
In the context of performance management, a performance problem
exists under the following circumstances:
An application fails to meet its predetermined SLA.
Application response time falls outside a predetermined range of baseline
performance.
Users report slow response time or poor throughput.

VMware vSphere: Optimize and Scale 4-14


2015 VMware Inc. All rights reserved.
Performance Troubleshooting Methodology
A performance troubleshooting methodology must provide guidance on
how to find the root cause of performance problems and how to fix the
cause when determined.
You should address the following questions:
What are the success criteria for this problem?
Where do you start looking for problems?
How do you know what to look for to identify a problem?
How do you find the root cause of a problem that you have identified?
What do you change to fix the root cause?
Where do you look next if no problem is found?

VMware vSphere: Optimize and Scale 4-15


2015 VMware Inc. All rights reserved.
Basic Troubleshooting Checklist for ESXi Hosts

1. Check for VMware Tools status.

2. Check for resource pool


CPU saturation. 11. Check for using only one vCPU
in a Virtual SMP virtual machine.
16. Check for low guest CPU
3. Check for host CPU saturation.
utilization.
12. Check for high CPU ready time
4. Check for guest CPU saturation. on virtual machines running in
17. Check for past virtual machine
underutilized hosts.
memory swapping.
5. Check for active virtual machine
memory swapping.
13. Check for slow storage device. 18. Check for high memory
demand in a resource pool.
6. Check for virtual machine swap wait.
14. Check for unexpected increase
7. Check for active virtual machine in I/O latency on a shared 19. Check for high memory
memory compression. storage device. demand in a host.

8. Check for an overloaded 20. Check for high guest memory


15. Check for unexpected increase demand.
storage device.
in data transfer rate on
9. Check for dropped receive network controllers.
packets.

10. Check for dropped transmit


packets.

Definite Problems Likely Problems Possible Problems

VMware vSphere: Optimize and Scale 4-16


2015 VMware Inc. All rights reserved.
Review of Learner Objectives
You should be able to meet the following objectives:
Review components of the VMware ESXi architecture
Describe fundamentals of performance
Define a performance problem
Discuss the VMware vSphere performance troubleshooting methodology

VMware vSphere: Optimize and Scale 4-17


2015 VMware Inc. All rights reserved.
Lesson 2:
Monitoring Tools

4-18
2015 VMware Inc. All rights reserved.
Learner Objectives
By the end of this lesson, you should be able to meet the following
objectives:
Discuss the available monitoring tools
Use VMware vCenter Server performance charts
Use the resxtop command
Discuss guest operating system-based performance tools
Describe how to choose the correct tool for a given situation

VMware vSphere: Optimize and Scale 4-19


2015 VMware Inc. All rights reserved.
Performance Monitoring Tools
Performance analysis on virtual deployments should always use host-
based tools, such as vCenter Server performance charts or the resxtop
utility:
vCenter Server performance charts are viewed with VMware vSphere Web
Client or VMware vSphere Client:
Overview chart views provide a set of predefined charts that display the performance
for the last 24 hours.
Advanced chart views enable you to create and save customized charts, both real-
time and historical.
The resxtop utility collects every performance statistic needed and makes
statistics available in a way that is useful for analysis.
Guest operating system-based tools, such as Windows Perfmon and the
Linux top command, might not work accurately in a virtual machine.

VMware vSphere: Optimize and Scale 4-20


2015 VMware Inc. All rights reserved.
Overview Performance Charts
Overview performance charts show the performance statistics that
VMware considers most useful for monitoring performance and
diagnosing problems.

Partial Overview
Panel for a Hosts
Performance Charts

VMware vSphere: Optimize and Scale 4-21


2015 VMware Inc. All rights reserved.
Advanced Performance Charts
Advanced
performance charts
provide statistical
data for vSphere
objects, such as
data centers,
clusters, and ESXi
hosts.

VMware vSphere: Optimize and Scale 4-22


2015 VMware Inc. All rights reserved.
Customizing Performance Charts
To help sort and display the data in useful formats, you can customize
the advanced performance charts with various chart parameters.

Timespan

Previously Saved Chart Type Objects


Chart Options
Rollups

Counters
Statistics Type

VMware vSphere: Optimize and Scale 4-23


2015 VMware Inc. All rights reserved.
Timespan: Real-Time and Historical
The collection interval (timespan) and collection level (data frequency)
determine how much statistical data is collected and stored in your
vCenter Server database.
vSphere Web Client can show real-time data and historical data:
Real-time information is generated for the past hour at a 20-second granularity.
Historical information is generated for the timespans, or collection intervals,
listed in the table.

Timespan Data Frequency Number of Samples


Real-Time (past hour) 20 seconds 180
Past Day 5 minutes 288
Past Week 30 minutes 336
Past Month 2 hours 360
Past Year 1 day 365

VMware vSphere: Optimize and Scale 4-24


2015 VMware Inc. All rights reserved.
Chart Types
Performance charts graphically display CPU, memory, disk, network, and
storage metrics for devices and entities that are managed by vCenter
Server.
Charts come in the following types:
Line graph: Displays metrics for a single inventory object
Stacked graph: Displays metrics for children of the selected parent object. Use
stacked graphs to compare data across virtual machines.
Bar chart: Display storage metrics for datastores in a selected data center.
Pie chart: Display storage metrics for a single datastore or virtual machine.

VMware vSphere: Optimize and Scale 4-25


2015 VMware Inc. All rights reserved.
Objects and Counters
You can control the amount of information that a chart displays by
selecting one or more objects and counters.
Objects are instances or aggregations of devices:
vCPU0, vCPU1, vmhba1:1:2, aggregate over all NICs

Counters identify which statistics to collect:


CPU: used time, ready time, usage (%)
NIC: network packets received
Memory: memory swapped

VMware vSphere: Optimize and Scale 4-26


2015 VMware Inc. All rights reserved.
Statistics Type
The statistics type is a measurement used during the statistics interval.

Statistics Type Description Example

Rate Value over the current interval CPU usage (MHz)


Delta Change from previous interval CPU ready time
Absolute Absolute value (independent of interval) Memory active

The statistics type is related to the unit of measurement:


For example, megahertz (MHz), milliseconds (ms), megabytes (MB)

VMware vSphere: Optimize and Scale 4-27


2015 VMware Inc. All rights reserved.
Rollup Type
The rollup type is the calculation method used during the statistics
interval to roll up data.
Examples:
5 minutes of past-hour statistics are converted to 1 past-day value:
15 twenty-second statistics are rolled up into a single value.

30 minutes of past-day statistics are converted to 1 past-week value:


6 five-minute statistics are rolled up into a single value.

Rollup Type Conversion Function Sample Statistic


Average Average of data points CPU usage (average)
Summation Sum of data points CPU ready time (milliseconds)
Latest Last data point Uptime (days)
Minimum Minimum value is rolled up CPU usage (minimum)
Maximum Maximum value is rolled up CPU usage (maximum)

VMware vSphere: Optimize and Scale 4-28


2015 VMware Inc. All rights reserved.
Exporting Charts
You can use the Export icon above the chart to export performance data
as an image or a set of values.
The chart can be
exported in these
formats:
PNG
JPE
CSV

VMware vSphere: Optimize and Scale 4-29


2015 VMware Inc. All rights reserved.
resxtop Utility
The resxtop utility enables command-line monitoring and collection of
data for system resources: CPU, memory, disk, and network.
You can use the resxtop utility to examine real-time and historical
resource usage for ESXi hosts.
resxtop operates in the following modes of execution:
Interactive mode
Batch mode

An additional mode, replay mode, is available with the esxtop utility,


which is available in VMware vSphere ESXi Shell.

VMware vSphere: Optimize and Scale 4-30


2015 VMware Inc. All rights reserved.
Using resxtop Interactively
To use resxtop in interactive mode:
1. Log in to a system installed with VMware vSphere Command-Line Interface.
2. Run resxtop with one or more connection parameters.
# resxtop --server vc01.vmeduc.com
--username administrator --vihost esxi01.vmeduc.com
3. In the resxtop window, enter a character to change the screen or behavior.
Commands are case-sensitive.
Sample resxtop commands:
. Enter c for CPU view (default).
. Enter m for Memory view.
. Enter n for Network view.
. Enter u for Storage (disk) device view.

VMware vSphere: Optimize and Scale 4-31


2015 VMware Inc. All rights reserved.
Using resxtop in Batch Mode
To use resxtop in batch mode and print all performance counters, run
the following command:
resxtop -server esxi01 a b > analysis.csv
The a option shows all statistics.
Always start your virtual machines before running resxtop in batch
mode.
resxtop produces virtual machine data based only on the virtual
machines that are running at the time that the command is launched.

VMware vSphere: Optimize and Scale 4-32


2015 VMware Inc. All rights reserved.
Analyzing Batch Mode Output with Perfmon
Running resxtop in batch mode with all the counters enabled results in
a large CSV file that cannot easily be parsed.
The batch output
file from resxtop
can be readily
consumed by
Perfmon.

VMware vSphere: Optimize and Scale 4-33


2015 VMware Inc. All rights reserved.
Using esxtop in Replay Mode
esxtop can be used in replay mode to replay resource utilization
statistics collected using vm-support.
To use esxtop in replay mode:
1. Use vm-support to create a file with sampled performance data.
For example: vm-support p d 300 i 30
2. Unzip and untar the resulting .tar file so that esxtop can use it in replay
mode.
3. Run esxtop with the vm-support directory path as an argument.
esxtop R vm-support_dir_path

VMware vSphere: Optimize and Scale 4-34


2015 VMware Inc. All rights reserved.
Guest Operating System-Based Performance Tools
In general, guest operating system-based performance tools are not
aware of the virtual nature of the hardware that they are running on and
do not provide accurate metrics.
Guest tools that perform the following functions are safe to use:
Measure non-time-based metrics, such as free/swapped memory times
Strictly generate load, such as Iometer

Often, application-specific counters are available only through guest-based


tools:
For example, for Microsoft server applications such as SQL Server or Exchange

VMware Tools in vSphere includes a Perfmon DLL that provides additional


counters that give the guest visibility into host CPU and memory usage.

VMware vSphere: Optimize and Scale 4-35


2015 VMware Inc. All rights reserved.
Perfmon DLL in VMware Tools
The Perfmon DLL provides processor and memory counters to access
host statistics from inside a virtual machine.

VMware vSphere: Optimize and Scale 4-36


2015 VMware Inc. All rights reserved.
Choosing the Correct Tool (1)
Choose the correct monitoring tool for observing and collecting
performance data in your vSphere environment.
vSphere provides the following tools:
vSphere Web Client and vSphere Client:
Primary tools for observing performance and configuration data for one or more ESXi
hosts
Provide access to the most important configuration and performance information
Do not require high levels of privilege to access the data

resxtop:
Provides access to detailed performance data of a single ESXi host
Provides fast access to a large number of performance metrics
Requires administrator-level access

VMware vSphere: Optimize and Scale 4-37


2015 VMware Inc. All rights reserved.
Choosing the Correct Tool (2)
Guest operating system-based monitoring tools can lead to inaccurate
metrics in some situations, for example, overcommitted CPU resources.
Accuracy of in-guest tools is dependent on the guest operating system
and kernel version being used.

VMware vSphere: Optimize and Scale 4-38


2015 VMware Inc. All rights reserved.
Lab 3: VMware Monitoring Tools
Monitor memory, CPU, and storage performance
1. Start Database Activity in a Virtual Machine
2. Examine Host and Storage Overview Charts
3. Configure Advanced Performance Charts
4. Start resxtop
5. Explore resxtop Output
6. Run resxtop in Batch Mode
7. Use Windows Performance Monitor to Display Captured Statistics

VMware vSphere: Optimize and Scale 4-39


2015 VMware Inc. All rights reserved.
Review of Learner Objectives
You should be able to meet the following objectives:
Discuss the available monitoring tools
Use VMware vCenter Server performance charts
Use the resxtop command
Discuss guest operating system-based performance tools
Describe how to choose the correct tool for a given situation

VMware vSphere: Optimize and Scale 4-40


2015 VMware Inc. All rights reserved.
Key Points
The vSphere troubleshooting methodology is to follow a fixed-order flow
through the most common observable performance problems.
vCenter Server performance charts and resxtop are vSphere tools for
monitoring performance.
Guest-based performance monitoring is an inaccurate means of evaluating
performance in virtual deployments.
Questions?

VMware vSphere: Optimize and Scale 4-41


2015 VMware Inc. All rights reserved.

Potrebbero piacerti anche