BIHANA2015 - Hollis - Performance Tuning in Sap Hana PDF
BIHANA2015 - Hollis - Performance Tuning in Sap Hana PDF
BIHANA2015 - Hollis - Performance Tuning in Sap Hana PDF
Kurt Hollis
Deloitte
1
What We’ll Cover
2
Quick Overview of SAP HANA
• The SAP HANA database holds the bulk of its data in-memory for
maximum performance, but still uses persistent storage to
provide a fallback in case of failure
• During normal database operation, data is automatically saved
from memory to disk at regular save points
• Additionally, all data changes are captured in the redo log. With
each committed database transaction, the redo log is saved from
memory to disk.
• If a failure occurs (e.g., a power outage),
the database can be restarted in the same
way as any disk-based database, and
returned to its last consistent state by
replaying the redo log since the last
save point
Source: SAP 6
Column Tables
7
What We’ll Cover
8
Architecture Discussion
• Key points of the HANA architecture:
In-Memory Database The entire database is running in memory
Combines OLTP, OLAP, and HW Acceleration, eliminating
unnecessary complexity and latency
Strict hardware specifications for performance design reasons
16GB of memory per CPU core, fixed ratio of disk data storage to 4
times RAM, log storage = 1 times RAM
Two types of Relational Stores in HANA Row Store (common in
previous traditional databases) and Column Store (is what HANA
uses primarily)
Persistency Layer In-memory is volatile, so persistency layer
makes sure all data in memory is also stored on hard drive storage
Not only is data stored in HANA memory, but what makes it faster
is that the calculations are made in the database, and only the
results transfer to the application layer
9
Architecture
Source: SAP
10
HANA Scenarios
• HANA started as a standalone data mart, then added apps
• Content was added using Reporting and Analytics with SAP BusinessObjects
• HANA on Cloud
• BW on HANA
• Business Suite on HANA
Source: SAP 11
HANA Deployment Options
SAP Note 1666670 – Multiple SAP HANA DBs on one appliance Source: SAP
SAP Note 1661202 – Support for multiple applications on SAP HANA
SAP Note 1826100 – Multiple applications SAP Business Suite powered by SAP HANA
SAP Note 1681092 – BW on SAP HANA – landscape deployment planning
SAP Note 1788665 – SAP HANA running on VMware vSphere VMs 12
Sizing HANA
• Important SAP Notes about sizing HANA:
1514966 – Sizing HANA
1704499 – System Measurement for License Audit
1637145 – Sizing BW on HANA
• Static + Dynamic RAM requirements determine sizing. To do this, determine
uncompressed data volume to be loaded, then apply compression factor, then
multiply result by two.
• Only 50% of the total RAM should be used for the in-memory database. The
other 50% is needed for temporary objects (for example, intermediate results),
the operating system, and application code.
• Disk size for the persistence layer is equal to 4 times RAM
• Disk size for the log files equals 1 times RAM
• CPU equals 300 SAPS per active user. Never to exceed 65% of CPU server load.
• BW on HANA has a quick sizing tool available at:
https://service.sap.com/quicksizing *
• HANA is available in incremental sizes: XS, S, M, L
* Requires login credentials to the SAP Service Marketplace 13
HANA on VMware
• SAP and VMware announced support for deploying SAP HANA (SPS05 or
greater) virtualized using VMware vSphere 5.1 and recently vSphere 5.5
• Single-node deployments only running virtualized with VMware vSphere on
certified hardware or tailored DC and within the current limits of VMware
vSphere of 64 virtual CPUs and 1 TB of memory for use within non-
production scenarios (Up to 1TB memory, 768GB usable)
• Multiple virtual machines can be deployed on a single SAP HANA appliance
• Each SAP HANA instance deployed on a virtual machine is recommended to
be sized the same as SAP HANA deployed on “bare metal” SAP HANA
appliances
• For single node (non-clustered) SAP HANA deployments
• Alternative with SAP HANA tailored data center integration approach:
SAP HANA installation was done by an SAP-certified engineer
SAP HANA tailored data center integration configuration has been verified
with SAP HANA hardware verification tool; respective hardware
requirements do apply
No over-provisioning of RAM or CPU is allowed for SAP HANA
14
Improvements to HANA SPS Releases
• SAP is now providing two SP stack revisions per year for SAP
HANA systems
• Introduction of the Verified Revision, which is tested in a
Productive system
Source: SAP
15
Scale-Out Architecture
16
What We’ll Cover
17
Performance Overview
18
Performance Consideration Areas
20
Areas of HANA Performance Problems and Analysis
• Memory Problems
• CPU-Related Root Causes and Solutions
• Disk-Related Root Causes and Solutions
• Delta Merge
• Security-Related Issues
• Transactional Problems
• Statement Performance Analysis
• Application Performance Analysis
• Tools and Tracing
• System Performance Analysis
• SQL Statement Analysis
• Query Plan Analysis
• Advanced Analysis
• Additional Analysis Tools for Support
21
Host Resources
• Typical reasons for a slow system are resource shortages of CPU,
memory, disk I/O, and, for distributed systems, network performance
Common HANA Performance Issues
Disk I/O
Network I/O
• SQL statements dispatched by other users, which can block a lot of
resources. In the case of memory, this can lead to unloads of tables
when a table has to be reloaded into memory, which affects future
SQL statements
• Another reason for poor performance, which in many cases cannot
be detected by the SAP HANA instance itself, are other processes
running on the same host that are not related to SAP HANA. You can
use the operating system tools to check for such processes. Note
that SAP only supports production systems running on dedicated
hardware.
22
Non-HANA Performance Issues
29
Delta Storage and Merge Operations
Source: SAP 30
Delta Merge Issues
31
SQL Statements Performance Issues
• Slow Individual SQL Statements
Blocked transactions (Threads)
Delta Merge operation (based on long runtimes and thresholds)
• Increasingly Long Runtime
• Slow individual SQL Statements or increasingly long runtimes Issues
with the performance of a particular statement can be caused by a
number of very different root causes
• In principle, a statement can trigger all the resource problems that
also lead to an overall slowdown of the system, so most of the
previous information also applies to statement performance. In
addition, statement performance can suffer from transactional
problems, that is, blocked transactions.
• Blocked transactions can be checked in the Threads tab
• A transactionally blocked thread is indicated by a warning icon ( ) in
the Status column
32
Transaction Performance Issues
35
Recommendations (cont.)
36
What We’ll Cover
37
HANA Studio — Administration Console
• Daily checks always include the Overview Screen in the Administration
Console Perspective
• Check All Services Started, Alerts and Messages, the Memory, CPU, and the
Disk Usage
Choose Overview to view the overall status, memory
Alerts
Memory Usage
38
Using the Administration Console for Memory
Source: SAP 39
Using the Administration Console for Memory (cont.)
Source: SAP 40
HANA Monitoring Dashboard
41
New Memory Overview (Since SP07)
42
New Resource Utilization Views
• Second of the two new views from the HANA Studio (SP07
onwards)
• Select from the column’s CPU, Memory, Disk to see the graph
values over time
43
HANA Studio — Administration Console —
Performance
• Performance tab is important to see the activities on the database
and perform system analysis
• Check the active threads, sessions, blocked transactions, SQL
plan cache, expensive statements, job progress, and the load in
graphical views
44
HANA Studio — Administration Console — System
Information and Diagnosis
• System Information and Diagnosis Files tabs provide quick and easy access to
common queries about the system and to the logs and traces. Traces are set up
in the Trace Configuration tab.
45
DBA Cockpit
• In the ABAP system transaction DBACOCKPIT, very similar to the HANA
Studio
• Used for Administration Tasks Scheduling backups, some configuration
changes
• Performing Monitoring Tasks Detailed views of Services, Volumes,
Performance
• Alerting Critical monitoring allows for alert generation automatically (uses
CCMS)
• Tracing – Setting trace levels and displaying trace files
46
Performance Load
47
Session Monitor
48
Blocked Transactions
49
Threads
50
SQL Plan Cache
51
Expensive Statements Trace
52
Live Demonstration of HANA Performance
Monitoring
• Next is a Live Demonstration of some common performance
analysis functions:
HANA version 8.0 or higher is used for this demo
53
Other Administration Tasks
55
Performance Checks To-Do
Check Item Description, Impacts to Performance
HANA Patch Level Patches include additional performance optimizations and bug fixes, latest HANA
revision is recommended
Parameter Settings Use HANA Configuration Parameters with setting
ONLY_RECOMMENDATION_DEVIATIONS = “X” to check recommended settings (See
SAP Note 1969700)
Network Check Verify Network Bandwidth and Latency is correct (See SAP Note 1100926)
HANA HW configuration Perform all recommendations for checking the HANA system configuration (See SAP
Note 2000003)
ABAP Parameter Verify HANA-related profile parameters are set to defaults, such as rsdb/max blocking
Settings factor (See SAP Note 1987132)
I/O Analysis Slow I/O can impact startup times, save points, commits, or reloads (See SAP Note
1999930)
SQL Statement Check for expensive SQL statements and optimize them from SAP HANA or application
Optimization perspective (See SAP Note 2000002)
Lock Analysis Check Check for lock waits and optimize them from SAP HANA or application perspective (See
SAP Note 1999998)
Activated Traces Activated traces can have an impact on performance, so you should only activate as few
traces as possible. The activation and modification state of some (but not of all) traces
can be checked using SQL (See SAP Note 1969700).
56
HANA Performance Checks
• Check how many threads are running, what are they working on, and is
any of the threads are blocked
• Check if sessions are blocking current transactions
• Check if any operations are running for a significantly long time and
consuming a lot of resources
• Compare different hosts in terms of performance
• Check for blocked transactions or transaction blocked threads, since
these can impact application responsiveness
• Check active/inactive sessions and their relation to applications
• Check statistics, like average query runtime
• Check for long running jobs that are running for an excessively long
time and consuming a considerable amount of resources
• Check load monitoring graphical display
• Analyze SQL traces, expensive statements, and SQL plan cache
• Run the HANA Mini Checks (see SAP Note 1969700)
57
Troubleshooting — Log Full Situations
• Avoiding LOG FULL (file system full) situations
When the log is backed up, the backed up log segments remain on disk until they
have been released automatically after a save point
After the log has released, the oldest unused log segment can be overwritten with
new log entries
If there are no unused log segments, new log segments are created
If the disk becomes full and no more log segments can be created, a log full
situation arises
When the log is full, no more logging is possible until the log backup has
completed
Solution Automatic log backup prevents log full situations from arising
• Avoid log backup area becoming full
Regularly archive old log backups to a different location using operating system
commands
Monitor disk space that is used for diagnosis files (Diagnosis Files tab)
Use SAP HANA Studio to delete diagnosis files that are no longer needed
• Caution: Do not delete log segments on the operating system level, as the log area
will become unusable and the database may stop working
58
Alerts
• Actively monitor the status of the system, the services, and the
consumption of the resources it uses with alerts. Alert tab in the
Admin perspective in the HANA Studio tool.
• Alerts for critical situations:
Disk is becoming full
CPU usage is reaching a critical level
Memory usage
Services inactive or restarted
• The statistics server is the main component of the monitoring
infrastructure and collects information about status, performance,
and resource usage from all components of the database
• The statistics server issues an alert based on the priority level of
the alert (example – low priority alert for 90% disk space used and
critical alert for 98% used)
59
Troubleshooting — HANA Database Issues
May need to open SAP OSS connection for assistance and send
logs to SAP using download files (uses zip format)
Crash dumps may be collected and analyzed
Note: Monitor disk space that is used for diagnosis files and delete files that are no longer needed located in
/usr/sap/<SID>/HDB<instance>/<host>/trace
60
Analyze Logs, Traces, and Performance Using
HANA Studio
1. Check the System Information – double-click each task to execute
the SQL command and display the result
2. Check the Diagnosis files – double-click each log file to see the
content
3. Activation and Deactivation of traces is done from the Trace tab
on the Admin Perspective. Click the Edit button next to each trace
to see the details. Turn on traces when encountering problems
with the HANA system.
4. Monitor disk space that is used for diagnosis files
5. Monitor performance using the HANA Studio and DBA Cockpit
61
Commit Operations Optimization
• During COMMITs, the changes of the transaction are persisted to
disk and made visible for other transactions. Certain factors can
influence the time of COMMIT operations, such as Disk I/O and
Synchronous system replication mode.
• Disk I/O writes performance to logs During COMMITs, the
change information is written to the log files. If writing data is slow,
the COMMIT times can increase (See SAP Note 1999930).
• Synchronous system replication mode for DR (Disaster Recovery)
systems If a synchronous system replication mode is activated,
changes are propagated to the replication side during a COMMIT,
and the local session has to wait for an acknowledgement. Check is
switching to a less critical system replication mode (e.g., SYNC
SYNCMEM or SYNCMEM ASYNC) to improve the performance.
• Analyze if there are unnecessary replication delays due to limited
network bandwidth or high latency times
62
What We’ll Cover
63
Where to Find More Information
64
SAP HANA Troubleshooting and Performance
Analysis Guide
From help.sap.com/hana 65
Where to Find More Information
66
HANA FAQ NOTES
2044468 FAQ: SAP HANA Partitioning
2057046 FAQ: SAP HANA Delta Merges
2073112 FAQ: SAP HANA Studio
2081591 FAQ: SAP HANA Table Distribution
2100040 FAQ: SAP HANA CPU
2100009 FAQ: SAP HANA Savepoints
2101244 FAQ: SAP HANA Multitenant Database Containers
2112604 FAQ: SAP HANA Compression
2114710 FAQ: SAP HANA Threads and Thread Samples
2115815 FAQ: SAP HANA Database Patches and Upgrades
2116157 FAQ: SAP HANA Consistency Checks and Corruptions
2124112 FAQ: SAP HANA Parsing
2127458 FAQ: SAP HANA Loads and Unloads
1640741 FAQ: "DB users for the DBA Cockpit for SAP HANA“
2103477 Too many compressed alert trace files
67
HANA FAQ NOTES (cont.)
2057595 FAQ: SAP HANA High Availability
2082286 FAQ: SAP HANA Graph
2000003 FAQ: SAP HANA
1642148 FAQ: SAP HANA Database Backup & Recovery
2039883 FAQ: SAP HANA Database and storage snapshots
2104291 FAQ - SAP HANA Multitenant database containers
2053330 FAQ: Operations Recommendation on SAP HANA Alerts
2000000 FAQ: SAP HANA Performance Optimization
2000002 FAQ: SAP HANA SQL Optimization
1999998 FAQ: SAP HANA Lock Analysis
1999930 FAQ: SAP HANA I/O Analysis
1999997 FAQ: SAP HANA Memory
1999880 FAQ: SAP HANA System Replication
1969700 SQL statement collection for SAP HANA
2122650 Hana Server Crashes (OUT OF MEMORY) occurred
68
HANA FAQ NOTES (cont.)
81065 Troubleshooting SAP HANA Network
2031037 Upgrade to SAP_BASIS 740 or NetWeaver® Kernel 74x
2013043 Performance Problems with Enqueue Work Process
1999020 SAP HANA: Troubleshooting database is no longer reachab
1987132 SAP HANA: Parameter setting for SELECT FOR ALL ENTRIES
1917938 Migration of the statistics server for Revision 74 or higher
1835075 Analyze backup and recovery performance issues
1694864 Very long Commit Times
1601951 Self Service 'SQL Statement Tuning' - Prerequisites and FAQ
1100926 FAQ: Network performance
805934 FAQ: Database time
1840954 Alerts related to HANA memory consumption (OOM) dump files.
706478 Preventing Basis tables from increasing considerably
69
SAP Services for Performance Analysis
70
7 Key Points to Take Home
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or
an SAP affiliate company) in Germany and other countries. All other product and service names mentioned are the trademarks of their respective
companies. Wellesley Information Services is neither owned nor controlled by SAP SE.
About Deloitte
Deloitte refers to one or more of Deloitte Touche Tohmatsu Limited, a UK private company limited by guarantee, and its network of member firms, each
of which is a legally separate and independent entity. Please see www.deloitte.com/about for a detailed description of the legal structure of Deloitte
Touche Tohmatsu Limited and its member firms. Please see www.deloitte.com/us/about for a detailed description of the legal structure of Deloitte LLP
and its subsidiaries. Certain services may not be available to attest clients under the rules and regulations of public accounting.
This presentation should not be interpreted as a representation about or endorsement of any third party products, including SAP software.
This publication contains general information only and Deloitte is not, by means of this publication, rendering accounting, business, financial,
investment, legal, tax, or other professional advice or services. This publication is not a substitute for such professional advice or services, nor should it
be used as a basis for any decision or action that may affect your business. Before making any decision or taking any action that may affect your
business, you should consult a qualified professional advisor.
Deloitte shall not be responsible for any loss sustained by any person who relies on this publication.
73
Wellesley Information Services, 20 Carematrix Drive, Dedham, MA 02026
Copyright © 2015 Wellesley Information Services. All rights reserved.