sap hana sps10- workload management

14
1 © 2014 SAP AG or an SAP affiliate company. All rights reserved. SAP HANA SPS 10 - What’s New? Workload Management SAP HANA Product Management June, 2015 (Delta from SPS 09 to SPS 10)

Upload: sap-technology

Post on 31-Jul-2015

851 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: SAP HANA SPS10- Workload Management

1© 2014 SAP AG or an SAP affiliate company. All rights reserved.

SAP HANA SPS 10 - What’s New? Workload Management

SAP HANA Product Management June, 2015

(Delta from SPS 09 to SPS 10)

Page 2: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 2Public

Agenda

Introducing HANA Workload-Management

Workload Types in HANA

Statement Execution and Resource Handling

Controlling resources in the HANA system (as of SPS09)

CPU consumption and CPU binding

Memory allocation

Prioritization

Workload Classes

Usage of Workload Classes

Administration and Monitoring of Workload Classes

Mapping of Workload Classes

Demo

Page 3: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 3Public

Workload Types in HANA

Workload Types

OLAP Workload OLTP Workload Mixed Workload Internal Workload

complex statements

long-running

mostly CPU-intensive, mostly

memory-intensive

e.g. reporting in Datawarehouse

systems

simple statements

short-running

mostly less CPU-intensive,

less memory-intensive

e.g. transactions in ERP

systems

OLAP + OLTP

e. g. modern ERP systems,

with transactional and analytical

reporting

housekeeping + admin tasks

could be CPU-intensive,

memory-intensive

e.g. merge, garbage collection,

backup, savepoint

Balance and manage all workload types in HANA for best response time and throughput based on customer needs !

Page 4: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 4Public

Statement Execution and Resource Handling

Session Layer

Execution

Plan

“statement”

“(simple) OLTP”

Jobs

“may delegate statement execution”

SQLExecutorThread-Pool

“HANA system-tasks”

Thread-Pool

“assign available threads”

“assign available threads”

Application A

JobExecutor

“(complex) OLAP”

OP

OP

OP

Session Context for Application A

“set statement-context

per session“

Information about resource policy for memory, concurrency, priority for a statement

“read config data”“

.ini files

system-tables

Plan

Operators

Page 5: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 5Public

Controlling resources in the HANA system (as of SPS09)

CPU resources

• [indexserver.ini] max_sql_executors controls the max #of parallel threads that can be used for simple (OLTP-) statements

• [indexserver.ini] max_concurrency controls the max #of parallel threads executing jobs for complex (OLAP-) statements

note: the max #of parallel threads can be exceeded in some situations in the HANA systems, due to internal reasons

• [daemon.ini] affinity-parameter assigns CPU-resources per HANA process

Memory allocation

• [indexserver.ini] statement_memory_limit controls the memory consumption of statements ( can be altered per db-user manually)

Execution priority (available with SPS09)

• ALTER USER SYSTEM SET PARAMETER PRIORITY = <prio>

• sets user-level priority for all statements in the current connection between 0 …9 (default: 5)

.ini-parameters control resource management of the complete HANA-DB

Page 6: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 6Public

Introducing Workload Classes

Datamart-App

Administrator Tasks:

• create workload classes

• create workload mapping

ERP-App, App_Name “MRP”

ERP-App, App_Name “MyDashboard”

DB-user “DATAM”

DB-user “ERP001”

DB-user “ERP001”

HANA System

Workload “DATAM”session-context

session-context

session-context Workload “BW”

resource-config

resource-config

Workload “MRP”

resource-config

Workload “MYDASH”

resource-config

statm-context

statm-context

statm-context

mapping

mapping

mapping

Page 7: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 7Public

Administrating Workload Classes

Step 1: Create Workload Class (WORKLOAD_CLASSES)

Create a workload class in the HANA Studio SQL console with the following resource properties:

– statement_thread_limit = max #of parallel threads to execute a statement

– statement_memory _limit = max #of memory allocated per statement

– statement_priority = execution priority for a statement

You can set all resource properties or only a subset

SQL Syntax: <CREATE|ALTER|DROP> WORKLOAD CLASS <NAME> [SET <PROPERTY LIST>]

Example: create workload class "MRP" set 'PRIORITY' = '6', 'STATEMENT MEMORY LIMIT' = '2' , 'STATEMENT THREAD LIMIT' = '20'

Step 2: Create Workload Mapping (WORKLOAD_MAPPINGS)

Create workload mapping based on client context information (‘ClientInfo object’ sent by the HANA application):

– Client = client number (usually applied by SAP ABAP applications, like SAP Business Suite / BW)

– Application Name = name of the application

– Application User Name = name of the application user (usually the user logged into the application)

– User Name = name of the db-user (the HANA user, where the application is connected technically with)

SQL Syntax: <CREATE|ALTER|DROP> WORKLOAD MAPPING <NAME> WORKLOAD CLASS <WC NAME> [SET <PROPERTY LIST>]

Example: create workload mapping "MRPCLIENT" workload class "MRP" set 'USER NAME' = 'ERP001', 'APPLICATION NAME' = 'MRP';

Page 8: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 8Public

Monitoring Views for Workload Classes

SYS.M_CONNECTIONS

SYS.M_PREPARED_STATEMENTS; SYS.M_ACTIVE_STATEMENTS

Page 9: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 9Public

Mapping of Workload Classes

Mapping of Workload Classes

Always the most specific workload class is mapped to a db-client

If no workload class can be mapped, the internal default values or .ini-parameter of the HANA-db are applied (default)

– statement_thread_limit => [internal default value] ‘0’ no limit

– statement_memory_limit => [.ini] statement_memory_limit

– statement_priority => [internal default value] ‘5’

If a workload class has only a subset of the resource properties defined, the internal default values or .ini parameter-values are applied for the remaining properties

Client

WCLERP

WCLALFAPPLICATION_USER_NAME = ‘ALF’

USER_NAME = ‘ERP001’

APPLICATION_USER_NAME = ‘ALF’

CLIENT = ‘001’

APPICATION_NAME = ‘MRP’

USER_NAME = ‘ERP001’

CLIENT = ‘001’

APPICATION_NAME = ‘MRP’

USER_NAME = ‘ERP001’

Mapping

Page 10: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 10Public

Mapping of Workload Classes

Priority of ClientInfo properties for mapping

If two workload classes have the same matching number of ClientInfo properties, the workload class is applied that matches properties with

higher priority

There is the following priority:

1. Application_User_Name

2. Client

3. Application_Name

4. User_Name

Client

WCLERP

WCLALF

APPLICATION_USER_NAME = ‘ALF’

CLIENT = ‘001’

APPICATION_NAME = ‘MRP’

USER_NAME = ‘ERP001’

CLIENT = ‘001’

APPICATION_NAME = ‘MRP’

USER_NAME = ‘ERP001’

APPLICATION_USER_NAME = ‘ALF’

APPICATION_NAME = ‘MRP’

USER_NAME = ‘ERP001’

Mapping

Page 11: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 11Public

Additional Remarks

Privileges

Managing workload classes requires the ‘WORKLOAD ADMIN’ privilege

Changing Workload Classes

Changes of workload classes or mappings will only be applied, if a (connected) db-client re-connects

You can change the running session-context of a connected db-client via SQL-command ‘ALTER SYSTEM ALTER SESSION SET'

Multi-Database Containers (MDC)

Workload classes work also in a multi-database environment, but you need to define workload classes for each single db-container

Scale-out

Workload classes are applied to the complete HANA-db in a scale-out environment, but not to each single node

Dropping users / workload classes

If you drop a user in the HANA-db, all related workload classes are dropped

If you drop a workload class, the related mappings are dropped

Setting the ClientInfo in the application

The client info is a list of property values pairs that an application can set in in the client interface

Page 12: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 12Public

DEMO

Page 13: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 13Public

Disclaimer

This presentation outlines our general product direction and should not be relied on in making

a purchase decision. This presentation is not subject to your license agreement or any other

agreement with SAP.

SAP has no obligation to pursue any course of business outlined in this presentation or to

develop or release any functionality mentioned in this presentation. This presentation and

SAP’s strategy and possible future developments are subject to change and may be changed

by SAP at any time for any reason without notice.

This document is provided without a warranty of any kind, either express or implied, including

but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or

non-infringement. SAP assumes no responsibility for errors or omissions in this document,

except if such damages were caused by SAP intentionally or grossly negligent.

Page 14: SAP HANA SPS10- Workload Management

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Thank you

Contact information

Rüdiger Karl

SAP HANA Product Management

[email protected]