B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

39
Insight Technology, Inc. Big Data Solution Division Akira Ichikawa Copyright © 2012 Insight Technology, Inc. All Rights Reserved. 1

Transcript of B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Page 1: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Insight Technology, Inc.

Big Data Solution Division

Akira Ichikawa

Copyright © 2012 Insight Technology, Inc. All Rights Reserved. 1

Page 2: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

2 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

InfinibandやSSDを含め、最近のハードウェアテクノロジーは、日々進歩しています。 ↓ 最新のハードウェアテクノロジーの恩恵を SQLServer 2012のストレージとして使えるようになりました。 ↓ 最新のハードウェアを使い、どの程度 SQLServer のパフォーマンスがでるかを検証してみました。

Overview Presentation

Page 3: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

1. About Me… 2. Why SQLServer 2012 is Super hot !? 3. A new feature of the SMB 3.0 4. SMB Direct Performance. 5. What is Insight Qube ?? 6. Configuration. 7. Future of SQL Server with Hardware Innovation.

Copyright © 2011 Insight Technology, Inc. All Rights Reserved

Agenda.

Copyright © 2012 Insight Technology, Inc. All Rights Reserved. 3

Page 4: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

4 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

2011.8 Insight Technology に入社。 Oracle, SQL Server のエンジニアとして 経験を活かしてコンサルを目指すも、、、 2012.4 ~ Bigdata に関わる業務をこなす 日々を送っています。

About me ...

Page 5: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

5 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

・AlwaysOn (高可用性 ↑ ) ・Column Store Index (DWH機能 ↑ ) ・SMB3.0 をSQL2012からサポート・・・★ ⇒ SMBファイルサーバをSQLServerのストレージ として使えるため、高速にデータ転送可能。

Why SQLServer2012 is Super hot ??

Page 6: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

6 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

以前は、、可用性を向上させるためにWSFCやDBMなどの技術でシステムを構築。 ※WSFC:SANやiSCSIの共有ストレージが必要 ※DBM:監視サーバが必要

AlwaysOn

2012では、AlwaysOnで可用性を向上。プライマリに対して複数のセカンダリにレプリカが作成可能で、障害発生時の自動的なF/O, バックアップ, 負荷分散などを実現。 ※共有ストレージは不要で、ファイルサーバをクラスタ化

Page 7: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

7 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

Databaseのデータ(行データ)から、特定の列(カラム)だけを取り出し、圧縮してインデックスを作成する機能です。 DISTINCT や GROUP BYを使う集計などが高速化され、夜間バッチ処理やDWHの集計処理で威力を発揮します。 ※集計処理において、Column Store Index を利用すると50倍~100倍の高速化を実現。(インデックス付きのスキャンより高速化されている)

Column Store Index

Page 8: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

8 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

高速なストレージを使用可能にする 注目すべき新機能は、、、

・SMBダイレクト ・SMBマルチチャンネル

A new feature of the SMB 3.0

Page 9: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

9 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

SMB Direct (SMB over RDMA)は、Windows Server 2012に実装されている新しいストレージプロトコルで、RDMA機能をもつNetworkAdapter(HCA)をサポート。

SMB Direct

Remote Direct Memory Access(RDMA)とは、独立したシステムのメインメモリ間、システムとストレージ間のデータ転送でOSを介さないため、高スループット、低レイテンシの通信を行うことができる。 ※CPU負荷も軽減

Page 10: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

10 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

Transport、NetworkレイヤをHCAのチップが ハードウェアで処理します。

Reference by Mellanox Technologys

CPU Offload

Page 11: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

11

Configuration MB/sec %CPU RDMA (IOS:512KB) 5,792 ~ 4.8 LOCAL(IOS:512KB) 5,808 ~ 6.6

Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

Ex) StorageにFlash Memory を使用した場合

Reference by Jose Barreto's Blog

SMB Direct Performance

RDMAを使うことで、リモートディスクのスループットは、ローカルと比較して、99 % のスループットを達成。 参考: OCZ Talos2 R (Read 550MB/s) * 14, PCIe 2.0 x8 2.21GB/s

Page 12: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

12 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

SMB Multichannel

複数のパスがある場合、ネットワーク帯域幅を集約可能で自動的にフォールトトレラントを確保。

Multiple RDMA NICs

SMB Server

SMB Client

Switch IB

NIC IB

NIC IB

Switch IB

NIC IB

NIC IB

Reference by Microsoft TechEd 2012

自動でRDMA機能を持つNICを認識して、RDMAを使ってデータ転送を行う。

Page 13: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Using SMB Direct & MultichannelWithout Multichannel •No automatic failover •Can’t use full bandwidth –Only one NIC engaged –RDMA capability not used

With Multichannel •Automatic NIC failover •Combined NIC bandwidth available –Multiple NICs engaged –Multiple RDMA connections

Reference by Jose Barreto's Blog

13

Page 14: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

14 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

今回は、Insight Qube というハードウェアをSQLServerのベンチマーク検証に使いました。 ※製品紹介ではなく、構成について説明致します。

Next…Attempts to validate

Page 15: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

15 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

SSD, SATA3, PCI Express, InfiniBand で 構成されたクラスター型ハードウェア。

What is Insight Qube ??

~ Image ~ ・SSD(Read:500MB/s) ⇒ SATA3(帯域:600MB/s) ・SSD * 6 (Read:3GB/s) ⇒ PCIe2.0x8(帯域:500MB/s * 8) ・Storage Node(3GB/S) ⇒ InfiniBand(帯域:QDR 4GB/s)

Page 16: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

16 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

Storage-1

SQLServer

Storage-2 Strage-3

SSD SSD SSD

InfiniBand * 5 Fabric(40Gb/s)

Storage SSD(60GB) * 6

InfiniBand Switch(8 port)

Network adapter HCA * 5

Configuration

Page 17: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

17 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

Intel Xeon L5640 @ 2.27 GHz 6 processors(*2)

Memory 4GB*12 DDR3-1333 Unbuffered ECC

HCA(PCIe 2.0x8)

SQLServer Node

Page 18: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

18 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

Intel Xeon E5620 @ 2.40 GHz 4 processors

SATA3 x4 ⇔ SAS

Memory 2GB * 2 DDR3-1333 Registered ECC

HCA(PCIe 2.0x8)

Storage Node

Page 19: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

19 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

Windows 2012の SMB3.0 の機能により、Infiniband がサポートされ、SQL 2012 では、データファイルをSMBの共有ファイル上に置けるようになり、高速なストレージへのアクセスが可能になりました。 今後ハードウェアの進化に応じて、SQLServerのパフォーマンス向上が期待できます。

Future of SQLServer with HW Innovation

Page 20: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

20 Copyright © 2012 Insight Technology, Inc. All Rights Reserved.

続きは、marioさんにお願いします。 ご静聴有難うございました。

The next speaker is mario.

Groet !

Page 21: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

SQL Server 2012 using SMB3 file shares By Mario Broodbakker, Insight

Technology Inc

21

Page 22: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

whoami

• Joined Insight Technology in August 2011 mostly worked on SQL Server DMA. Helped ITI acquiring Oracle DMA techniques in 2003 already.

• Before that: over 10 years of performance engineering work on Oracle and SQL Server, working for Baan, Compaq and HP in Holland and USA.

• Started DBA career 25 years ago..

22

Page 23: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Windows 2012 SMB

• New version of SMB (Server Message Block protocol): SMB3.0

• New features that can be used for SQL Server: – SMB Direct: SMB using RDMA (see next slides) – SMB Multichannel, use multiple NICs for

throughput and failover (demo, if time permits) – VSS (volume snapshot service) for SMB file

shares, to enable backup/restore – SMB transparent failover (not yet on IQube..) – PowerShell scriptable

23

Page 24: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

SMB Direct 1 • RDMA: Remote Direct Memory Access

– Low latency protocol – Low CPU overhead

SQL Server

SMB Client

RDMA network

SMB Server

RDMA network

NTFS kernel

user

RDMA NIC

24

RDMA NIC

Page 25: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

SMB Direct 2

• Direct memory copy by NIC hardware (must be RDMA capable) – Bypass TCP/IP and OS stack: while NIC

hardware copies data, CPU can do other work • Transport Offload • Zero Copy • Kernel Bypass

• Can be used over any RDMA capable NIC like Infiniband, (10Gb) Ethernet.

• Different protocols: Infiniband, iWarp, RoCE • SMB client decides when to use RDMA

25

Page 26: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Advantages SMB

• Ease of use: everybody ‘understands’ file shares

• No configuration or specialist knowledge necessary to manage – Out-of-the-box (almost): SMB Multichannel,

automatic failover, auto detection – DBA can use standard perfmon counters to

understand IO load

26

Page 27: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

SQL Server on SMB

• Possible since SQL Server 2008R2 http://sqlcat.com/sqlcat/b/technicalnotes/archive/2010/05/07/top-10-hidden-gems-in-sql-2008-r2.aspx

– Create database and logfiles on shares: Create Database tpch100g on Primary (name=tpch100g, filename='¥¥fs1¥disk1¥tpch100g.mdf',size=10mb,filegrowth=0), FileGroup iqdemo ..etc..

– But needs Windows 2012 to use SMB Direct – Make sure SQL Server (domain) account has

permissions on the file share, and folders. – SQL Server 2012: System DB on file share: install

root directly on share – SQL Server AlwaysOn Failover Cluster supported http://www.sqlskills.com/blogs/jonathan/post/Failover-Clustering-without-a-SAN-SQL-Server-2012-and-SMB-for-Shared-Storage.aspx

27

Page 28: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Verify RDMA

• Why? SMB can choose to use RDMA or IP at runtime

• Also not all inbox drivers (and firmware combinations) work. – Perfmon Counters: RDMA Activity, SMB Direct

Connection .(SMB Server/Client Shares) – PowerShell: Get-NetAdapterRDMA, Get-

SmbServerNetworkInterface, Get-SmbClientNetworkInterface

– netstat.exe -xan | ? {$_ -match “445”}

28

Page 29: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

PowerShell commands

29

Page 30: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Mellanox toolbox C:¥Program Files¥Mellanox¥MLNX_VPI¥IB¥Tools>ibstat CA 'ibv_device0' CA type: Number of ports: 1 Firmware version: 0x2000903e8 Hardware version: 0xb0 Node GUID: 0x002590ffff2ed2bc System image GUID: 0x002590ffff2ed2bf Port 1: State: Active Physical state: LinkUp Rate: 40 Real rate: 32.00 (QDR) Base lid: 16 LMC: 0 SM lid: 15 Capability mask: 0x90580000 Port GUID: 0x002590ffff2ed2bd

30

Page 31: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Benchmarking your setup • Verify if all components work as expected

– Use an IO generator tool like sqlio or iometer – Understand that you are generating serious

amounts of IO. Therefore use multiple processes and multiple threads – Start testing local IO, then move on to network – Use big (>10GB) test files to get smooth

performance – Get a TPC-H kit from tpc.org (and scripts from

full disclosure reports posted by vendors)

31

Page 32: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Things to think about.. • Extent allocation: defaults to 1 extent (64k)

per file (round robin) ‘proportional fill’ • Use –E to get 64 extent proportional fill • Traceflags: -T834 (large pages), -T2301

(DSS optimizations http://support.microsoft.com/kb/920093

• Minimal logging options for dataloading, see also: – Microsoft Data loading performance guide

http://msdn.microsoft.com/en-us/library/dd425070.aspx

32

Page 33: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Insight Qube test

IB Switch

Windows 2012

SQL Server

ib

ib

ib

ib

ib

s

IB card: 3.5 GB/sec

disks2.5 GB/sec

PCI-E Gen2 x8 4 GB/sec

33

6.5 GB/sec

4.2 GB/sec

Page 34: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

Summary

• SMB, RDMA, Infiniband combination scales very well, mostly limited by PCI bus speeds

• Easy to understand and administer • Know your system, benchmark your

components and system.. or • Insight Qube can do it for you !

34

Page 35: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

3x SQLIO 128KB reads

35

Page 36: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

DB Server Query from 3 SMB servers

36

Page 37: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

SMB (file) Server 3

37

Page 38: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

SQLIO test run against 1 SMB server

38

Page 39: B14 SQL Server over SMB using infiniBand and SSD by Mario Broodbakker/市川明

無断転載を禁ず

この文書はあくまでも参考資料であり、掲載されている情報は予告なしに変更されることがあります。

株式会社インサイトテクノロジーは本書の内容に関していかなる保証もしません。また、本書の内容に関連したいかなる損害についても責任を負いかねます。

本書で使用している製品やサービス名の名称は、各社の商標または登録商標です。

Copyright © 2012 Insight Technology, Inc. All Rights Reserved. 39