More Related Content Similar to [db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と SQL Server vNext 最新情報 by 日本マイクロソフト株式会社 熊澤幸生 (20) More from Insight Technology, Inc. (20) [db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と SQL Server vNext 最新情報 by 日本マイクロソフト株式会社 熊澤幸生1. Superdome X 上の SQL Server 2014
OLTP 検証結果と
SQL Server 2016 最新情報
2015.6.12
日本マイクロソフト株式会社
SQL Server 技術顧問
熊澤 幸生
2. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Agenda
• 初めに
• 検証環境と検証ツール
• OLTP スケーラビリティ検証結果
• 発生した問題点と実施したチューニング
• SQL Server 2016 注目機能
• まとめ
3. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
SQL Server の歴史
• 第一世代 1994 - 1998
− SQL Server 4.2 / 6.0 / 6.5
− Sybase 社から技術提供を受け、Windows NT Server 上に移植
− 2KB/ページ 16KB/エクステント ページロック
• 第二世代 1998 - 2005
− SQL Server 7.0 / 2000
− Dr. Jim Gray / Dave Campbell 氏らを迎えアーキテクチャを刷新
− 8KB/ページ 64KB/エクステント 行ロックの導入
− SQLOSの採用
− Analysis Service / ETL の提供開始 / XML のサポート
• 第三世代 2005 - 2012
− SQL Server 2005 / 2008 / 2008R2
− IA32 から x64 への移行
− NUMA アーキテクチャの拡張
− クエリー並列処理機能の強化
− 動的管理ビューによる内部動作と問題点の可視化
− ラージオブジェクト格納への対応
− BI 機能の強化
− パラレル・データ・ウェアハウス
• 第四世代 2012 - 2015
− SQL Server 2012
− Non Clustered Columnstore Index
− Always On : HA DR 機能の強化
− Power View : Self Service BI 機能の強化
− SQL Server 2014
− Clustered Columnstore Index
− Insert / Update / Delete を透過的に処理可能
− インメモリー OLTP (Hekaton)
− SQL Server 2016 CTP2
− Clustered Columnstore Index v2
− インメモリー OLTP v2
− Query Store
− JSON / Temporal Table
4. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
ABC 戦略 SQL Server 開発手法
メインラインでは
• 信頼性
• パフォーマンス
• セキュリティ
等の基本機能を強化
・Appliance
・Box
・SQL Database
5. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Integrity Superdome X サーバー外観
SD2 OAモジュール
x2
パワーサプライ
(12 x 2450W)
DVD-
ROM
インターコネクト
モジュール x8 (NIC,
FC)
ブレード (LOM,
メザニンを含む)
BL920s Gen8
server blade
最大搭載数 8)
前面デザイン
背面デザイン
Insight Display
高さ:
18U
アクティブ冷却ファン
XBARファブリック
モジュール x4
(XFMs)
Global Partition
Service Modules x2
(GPSMs)
AC 入力モジュール
(3-phase or single-phase)
排気口
排気口
6. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
BL920s Gen8 サーバーブレード外観
48x 32GB or
16GB
DDR3 DIMMs
2x processor sockets for
Intel Xeon processor E7 v2
3x mezzanine slots 2x 10GigE
2-port FlexLOMs
XNC2 node
controller
iLO4
controller
Upper mid-plane
connector (fabric)
IO controller
Lower mid-plane
connector (IO & power)
Health LED
Power LED
UID
LED SUV Port
NIC status
LEDs
7. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
ベンチマークテスト方法について
• Integrity Superdome X を、SQL Server
2014 ベンチマークテスト環境 ( TPC-C に
準拠) でデータを取得し結果を比較する
− BL920S Xeon E7 v2 2890 2.8GHz 2 ソケット 30
物理コア 1.5 TB メモリー搭載のサーバーブレードを、
1 枚、2 枚、4 枚、8 枚と変化させ、最大で16 NUMA
ノード、240 物理コア、4 TB の環境を検証する
− SQL Server 接続スレッド数を変化させ、CPU 処理
能力限界値を検証する
8. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
ベンチマーク時 Superdome X 構成
・Blade 1 枚
Blade 1
・Blade 2 枚
Blade 1, 3
・Blade 4 枚
Blade 1, 3, 5, 7
・Blade 8 枚
Blade 1 - 8
9. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
負荷テストモデル
SQLStressTool
DB1 . . . . . . .
SQLStressToolSQLStressTool
SQLStressTool
DB2
SQLStressToolSQLStressTool
SQLStressTool
DB3
SQLStressToolSQLStressTool
SQLStressTool
DB16
SQLStressToolSQLStressTool
• 各 SQLStressTool.exe は 500 Threads を起動し、デー
タベースに接続し、240 秒間連続してトランザクション
を発行する
• データベースは同一構造を持つ
• データベース数は、Blade ごとに2つ作成し、最大 16DB
とする
10. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
負荷テストツールのパラメータ
• SQLStressTool.exe は、事前に定義したトラン
ザクションミックスをランダムに発行する<SQLSTRESS>
<CONFIGURATIONPARAMS>
<RUNTIME>240</RUNTIME>
<SQLSERVER>172.17.97.11</SQLSERVER>
<DATABASENAME>Northwind2</DATABASENAME>
<THREADSPERDATABASE>500</THREADSPERDATABASE>
<USEWARMUP>1</USEWARMUP>
<WARMUPSLEEP>5</WARMUPSLEEP>
<USEPOOLING>1</USEPOOLING>
<MAXPOOLCONNECTIONS>1100</MAXPOOLCONNECTIONS>
<THINKTIMEMIN>1000</THINKTIMEMIN>
<THINKTIMEMAX>2000</THINKTIMEMAX>
<VERBOSE>1</VERBOSE>
<REPORTSTATUSINTERVAL>5</REPORTSTATUSINTERVAL>
<CONNECTIONBEHAVIOR>1</CONNECTIONBEHAVIOR>
<DISCONNECTFREQUENCY>10</DISCONNECTFREQUENCY>
<BATCHTIMEOUT>60</BATCHTIMEOUT>
<CONNECTTIMEOUT>35</CONNECTTIMEOUT>
<USERNAME></USERNAME>
<PASSWORD></PASSWORD>
<USETRUSTED>1</USETRUSTED>
<FAIL_THRESHOLD_PERCENT>50</FAIL_THRESHOLD_PERCENT>
<NETLIB>TCP</NETLIB>
</CONFIGURATIONPARAMS>
<WORKLOAD>
<WORKITEM>
<ID>0</ID>
<QUERY><![CDATA[exec GetCustInfo]]></QUERY>
<WEIGHT>10</WEIGHT>
</WORKITEM>
<WORKITEM>
<ID>1</ID>
<QUERY><![CDATA[exec NewCustOrder]]></QUERY>
<WEIGHT>20</WEIGHT>
</WORKITEM>
11. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
トランザクション ミックス
Transaction Name 処理概要 Weight
参照・追加・更新テーブル名
1 2 3 4
GetCustInfo 顧客情報の照会 10 Customers
NewCustOrder 顧客からの受注処理 20 Orders Order Details
GetCustOrderDetails 顧客受注明細照会 8 Order Details Customers
GetCustOrderHistory 顧客受注履歴の照会 2 Products Order Details Orders Customers
UpdCustOrderShippedDate 出荷実績日時の更新 5 Orders
UpdCustOrderRequireDate 顧客希望納期の更新 5 Orders
GetCustProductOrderHistory 顧客別・商品別受注履歴照会 3 Products Order Details Orders Customers
GetCustContact 顧客担当窓口の検索 10 Customers
GetProductInfo 商品情報の検索 13 Products Suppliers
GetSupplierInfo 商品納入先の検索 13 Suppliers
SalesByCategoryByYear
カテゴリー別年次売上明細の
照会
1 Orders Products Categories
GetEmployeeInfo 従業員情報の検索 10 Employees
Total 100
12. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
負荷テストツールの実行ログ
17:48:06 INFO-LoadConfigurationInformation: Loading configuration from: Northwind_Stress_Demo_1.xml
*********************************************************************
SQL Server: 172.17.97.11
Database Name: Northwind
Trusted Security: ON
Threads Per Database: 500
Number of Databases: 1
Starting Database: 0
Run Time: 240 (seconds)
Reporting Interval: 5 (seconds)
Think Time (min): 1000 (milliseconds)
Think Time (max): 2000 (milliseconds)
Connection Ramp Up Time: 5 (milliseconds)
Connection Timeout: 35 (seconds)
Batch Timeout: 60 (seconds)
Failed Threshold: 70 (percent)
Pooling Behavior: OFF (Persistant Connections)
Verbose Error Reporting: True
*********************************************************************
17:48:06 INFO-StartStressRun: Starting worker threads.
17:48:11 INFO-MonitorThreadMain: Duration: 5 (sec) Succeeded: 311 Failed: 0 AvgRT: 11 (ms)
17:48:14 INFO-StartStressRun: Worker thread creation complete. 500 started.
17:48:16 INFO-MonitorThreadMain: Duration: 10 (sec) Succeeded: 1640 Failed: 0 AvgRT: 13 (ms)
17:48:21 INFO-MonitorThreadMain: Duration: 15 (sec) Succeeded: 3285 Failed: 0 AvgRT: 15 (ms)
17:48:26 INFO-MonitorThreadMain: Duration: 20 (sec) Succeeded: 4940 Failed: 0 AvgRT: 16 (ms)
17:48:31 INFO-MonitorThreadMain: Duration: 25 (sec) Succeeded: 6573 Failed: 0 AvgRT: 19 (ms)
17:48:36 INFO-MonitorThreadMain: Duration: 30 (sec) Succeeded: 8084 Failed: 0 AvgRT: 41 (ms)
17:48:41 INFO-MonitorThreadMain: Duration: 35 (sec) Succeeded: 9372 Failed: 0 AvgRT: 82 (ms)
17:48:46 INFO-MonitorThreadMain: Duration: 40 (sec) Succeeded: 10645 Failed: 0 AvgRT: 135 (ms)
17:48:51 INFO-MonitorThreadMain: Duration: 45 (sec) Succeeded: 11284 Failed: 0 AvgRT: 170 (ms)
17:48:56 INFO-MonitorThreadMain: Duration: 50 (sec) Succeeded: 11739 Failed: 0 AvgRT: 214 (ms)
17:49:01 INFO-MonitorThreadMain: Duration: 55 (sec) Succeeded: 12197 Failed: 0 AvgRT: 263 (ms)
17:49:06 INFO-MonitorThreadMain: Duration: 60 (sec) Succeeded: 13103 Failed: 0 AvgRT: 572 (ms)
17:49:11 INFO-MonitorThreadMain: Duration: 65 (sec) Succeeded: 14425 Failed: 0 AvgRT: 565 (ms)
17:49:16 INFO-MonitorThreadMain: Duration: 70 (sec) Succeeded: 15662 Failed: 0 AvgRT: 564 (ms)
13. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
今回の検証環境
• H/W 構成
− HP Integrity Superdome X
− Intel Xeon E7 v2 2890 2.8GHz 16 ソケット 240 コア
(Ivy Bridge EX)
− Memory 4TB
• S/W 構成
− Windows Server 2012 Datacenter R2
− SQL Server 2014 Enterprise Edition CU5
14. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Windows Server 2012 R2 Datacenter
15. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
SQL Server 2014 240 物理コア
16. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
16 Node NUMA 240 論理 CPU
17. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
1 Blade 2P30C (3,000 ユーザ接続)
18. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
2 Blade 4P60C (6,000 ユーザ接続)
19. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
4 Blade 8P120C (12,000 ユーザ接続)
20. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
8 Blade 16P240C (16,000 ユーザ接続)
21. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
16,000 同時結合ユーザ 待ち事象
wait_type
waiting_tasks
_count wait_time_ms
max_wait
_time_ms
signal_wait
_time_ms
SOS_SCHEDULER_YIELD 10,977,799 86,780,278 5,768 86,752,279
LCK_M_X 5,170 76,722,415 18,109 11,249
RESOURCE_SEMAPHORE_QUERY_COMPILE 13,570 51,267,713 58,558 55,185
ASYNC_NETWORK_IO 87,984 38,577,341 2,010 144,850
THREADPOOL 28,724 32,104,862 7,682 7
PAGELATCH_EX 186,484 7,075,712 2,964 330,095
WRITELOG 938,164 6,318,991 1,235 2,015,168
PAGELATCH_SH 49,718 4,368,679 2,944 97,144
SOS_PHYS_PAGE_CACHE 8,487 426,237 987 375,908
LCK_M_S 26,683 199,832 1,052 35,085
LCK_M_U 21,355 143,708 823 25,994
CMEMTHREAD 6,027 79,986 898 27,806
RESOURCE_SEMAPHORE 370 73,790 675 440
PAGEIOLATCH_EX 6,749 29,232 409 1,381
PAGEIOLATCH_SH 4,318 22,054 163 2,294
IO_COMPLETION 17,017 2,526 33 163
LCK_M_SCH_S 103 1,316 53 176
LCK_M_IX 95 1,122 214 152
EE_PMOLOCK 90 833 107 25
LATCH_EX 48 780 212 78
PAGEIOLATCH_UP 165 655 44 60
LOGBUFFER 159 439 45 229
22. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
16,000 同時ユーザ tempdb DB I/O
databasefile_id
size_on_disk_
bytes
num_of_
reads
num_of_bytes_
read
io_stall_read_
ms
io_stall_queued_read_
ms
num_of_
writes
num_of_bytes_
written
io_stall_write_
ms
io_stall_queued_write_
ms io_stall
tempdb data1 1,048,576,000 553 35,692,544 1,216 0 547 35,692,544 591 0 1,807
data2 1,048,576,000 559 35,438,592 1,208 0 552 35,438,592 549 0 1,757
data3 1,048,576,000 562 36,077,568 1,176 0 555 36,077,568 562 0 1,738
data4 1,048,576,000 570 36,470,784 1,183 0 561 36,470,784 555 0 1,738
data5 1,048,576,000 548 34,709,504 1,132 0 537 34,709,504 533 0 1,665
data6 1,048,576,000 564 36,118,528 1,143 0 557 36,118,528 535 0 1,678
data7 1,048,576,000 559 35,643,392 1,134 0 548 35,643,392 551 0 1,685
data8 1,048,576,000 552 35,291,136 1,134 0 544 35,291,136 583 0 1,717
data9 1,048,576,000 567 35,962,880 1,171 0 556 35,962,880 573 0 1,744
data10 1,048,576,000 562 35,971,072 1,169 0 555 35,971,072 605 0 1,774
data11 1,048,576,000 560 35,774,464 1,195 0 550 35,774,464 560 0 1,755
data12 1,048,576,000 554 35,332,096 1,137 0 544 35,332,096 583 0 1,720
data13 1,048,576,000 555 35,307,520 1,157 0 546 35,307,520 587 0 1,744
data14 1,048,576,000 553 35,340,288 1,137 0 546 35,340,288 558 0 1,695
data15 1,048,576,000 559 35,815,424 1,162 0 551 35,815,424 616 0 1,778
data16 1,048,576,000 560 35,438,592 1,182 0 546 35,438,592 602 0 1,784
data17 1,048,576,000 559 35,340,288 1,152 0 546 35,340,288 603 0 1,755
data18 1,048,576,000 558 35,905,536 1,177 0 552 35,905,536 576 0 1,753
data19 1,048,576,000 561 35,889,152 1,158 0 553 35,889,152 569 0 1,727
data20 1,048,576,000 579 36,724,736 1,245 0 564 36,724,736 614 0 1,859
data21 1,048,576,000 564 36,134,912 1,174 0 556 36,134,912 584 0 1,758
data22 1,048,576,000 573 36,528,128 1,241 0 561 36,528,128 575 0 1,816
data23 1,048,576,000 562 36,167,680 1,152 0 555 36,167,680 496 0 1,648
data24 1,048,576,000 568 36,569,088 1,166 0 560 36,569,088 548 0 1,714
data25 1,048,576,000 556 35,438,592 1,150 0 546 35,438,592 521 0 1,671
data26 1,048,576,000 567 36,306,944 1,180 0 561 36,306,944 567 0 1,747
data27 1,048,576,000 577 36,765,696 1,214 0 567 36,765,696 549 0 1,763
data28 1,048,576,000 551 35,233,792 1,156 0 545 35,233,792 498 0 1,654
data29 1,048,576,000 575 36,388,864 1,160 0 560 36,388,864 552 0 1,712
data30 1,048,576,000 576 36,741,120 1,197 0 565 36,741,120 575 0 1,772
data31 1,048,576,000 561 36,012,032 1,159 0 555 36,012,032 549 0 1,708
data32 1,048,576,000 566 35,749,888 1,182 0 550 35,749,888 568 0 1,750
total 33,554,432,000 17,990 1,148,280,832 37,499 0 17,691 1,148,280,832 18,087 0 55,586
log 1,048,576,000 0 0 0 0 291 17,879,040 922 0 922
23. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
16,000 同時ユーザ Northwind DB I/O
database file
size_on_disk_
bytes
num_of_
reads
num_of_bytes_
read
io_stall_read_
ms
io_stall_queued_read_
ms
num_of_
writes
num_of_bytes_
written
io_stall_write_
ms
io_stall_queued_write_
ms io_stall
Northwind data 524,288,000 1,206 74,579,968 10,339 0 2,690 54,181,888 7,246 0 17,585
log 1,048,576,000 0 0 0 0 34,704 110,183,936 26,823 0 26,823
Northwind2 data 524,288,000 1,208 74,588,160 14,550 0 2,688 54,550,528 6,644 0 21,194
log 1,048,576,000 0 0 0 0 35,693 111,434,752 29,757 0 29,757
Northwind3 data 524,288,000 1,264 75,202,560 9,084 0 2,708 53,698,560 5,534 0 14,618
log 1,048,576,000 0 0 0 0 32,846 110,689,792 28,578 0 28,578
Northwind4 data 524,288,000 1,209 74,678,272 8,723 0 2,693 53,633,024 5,830 0 14,553
log 1,048,576,000 0 0 0 0 29,572 107,244,544 25,571 0 25,571
Northwind5 data 524,288,000 1,194 73,973,760 13,379 0 2,679 53,010,432 6,555 0 19,934
log 1,048,576,000 0 0 0 0 32,955 105,495,552 28,708 0 28,708
Northwind6 data 524,288,000 1,204 74,440,704 7,886 0 2,649 51,470,336 5,657 0 13,543
log 1,048,576,000 0 0 0 0 31,119 104,607,232 29,579 0 29,579
Northwind7 data 524,288,000 1,246 74,539,008 10,320 0 2,678 51,134,464 6,128 0 16,448
log 1,048,576,000 0 0 0 0 32,101 103,561,728 28,584 0 28,584
Northwind8 data 524,288,000 1,203 74,309,632 12,620 0 2,662 52,469,760 6,277 0 18,897
log 1,048,576,000 0 0 0 0 33,087 107,830,272 29,049 0 29,049
Northwind9 data 524,288,000 1,138 71,360,512 9,086 0 2,706 52,142,080 6,658 0 15,744
log 1,048,576,000 0 0 0 0 38,977 110,368,256 34,014 0 34,014
Northwind10 data 524,288,000 1,204 74,514,432 11,262 0 2,666 51,273,728 5,358 0 16,620
log 1,048,576,000 0 0 0 0 35,523 107,482,112 29,544 0 29,544
Northwind11 data 524,288,000 1,206 74,432,512 8,878 0 2,693 52,297,728 6,409 0 15,287
log 1,048,576,000 0 0 0 0 33,560 109,623,808 29,310 0 29,310
Northwind12 data 524,288,000 1,246 74,309,632 8,629 0 2,687 52,125,696 6,814 0 15,443
log 1,048,576,000 0 0 0 0 30,994 103,070,720 27,685 0 27,685
Northwind13 data 524,288,000 1,368 79,806,464 11,197 0 2,676 52,912,128 6,177 0 17,374
log 1,048,576,000 0 0 0 0 36,822 111,943,680 30,507 0 30,507
Northwind14 data 524,288,000 1,201 74,399,744 6,013 0 2,666 52,928,512 6,642 0 12,655
log 1,048,576,000 0 0 0 0 36,561 109,835,776 30,590 0 30,590
Northwind15 data 524,288,000 1,258 74,858,496 8,319 0 2,700 53,485,568 6,041 0 14,360
log 1,048,576,000 0 0 0 0 34,605 108,836,864 29,660 0 29,660
Northwind16 data 524,288,000 1,218 75,104,256 7,428 0 2,685 53,280,768 8,150 0 15,578
log 1,048,576,000 0 0 0 0 30,500 111,944,704 26,455 0 26,455
Total data 8,388,608,000 19,573 1,195,098,112 157,713 0 42,926 844,595,200 102,120 0 259,833
log 16,777,216,000 0 0 0 0 539,619 1,734,153,728 464,414 0 464,414
24. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
ベンチマークテスト結果一覧
同時接続
ユーザ数
Transactions
/ Sec 比率 1 比率2
current_tasks
_count
runnable_tasks
_count
current_workers
_count
active_workers
_count
max_worker
_count
1 Blade 2P30C
Hyperthread_off 3,000 1,947.13 115 28 390 109 928
2 Blade 4P60C
Hyperthread_off 6,000 3,685.10 1.893 1.893 1,479 119 3,127 1,469 1,408
4 Blade 8P120C
Hyperthread_off 12,000 6,010.19 3.087 1.631 4,932 216 7,984 4,914 4,224
8 Blade 16P240C
Hyperthread_off
23,000 TCP Ports 16,000 7,368.01 3.784 1.226 993 302 12,330 959 8,064
25. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
ブレード増加による性能推移
0.00
1,000.00
2,000.00
3,000.00
4,000.00
5,000.00
6,000.00
7,000.00
8,000.00
1 Blade 2 Blade 4 Blade 8 Blade
Blade 増加による相対比率
1,947.13
3,685.10
6,010.19
7,368.01
0.00
1,000.00
2,000.00
3,000.00
4,000.00
5,000.00
6,000.00
7,000.00
8,000.00
1 Blade 2 Blade 4 Blade 8 Blade
transaction / sec
26. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
発生した問題点とチューニング
• NUMA 上の特定の Node の CPU 負荷が低下する
− SQL Server 2014 CU5 適用により解決
• PageLatch 多発により同時実行性が向上しない
− NUMA Node 単位の DB 分割と、テーブル内データ件数
増加により解決
• 8 Blade 負荷テストにおいて、スケールアップ性能
が伸びない
− ASYNC_NETWORK_IO (非同期ネットワーク I/O) が
急激に増加する
− TCP ポート数増加により、ある程度の改善はできた
− Windows Server 2012 R2 既定値 (15,000) を 23,000 に
レジストリを更新して増加させた
− SOS_SCHEDULER_YIELD と THREADPOOL が急激
に増加する
− Windows Server 上のプロセス内最大スレッド数制限 (32,767)
により、改善は不可能
27. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
特定 NUMA Node の負荷バラツキ
28. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
8 Blade 待ち事象の推移
Wait 事象 (単位 : ms) 12,000 同時結合ユーザ 16,000 同時結合ユーザ 18,000 同時結合ユーザ
ASYNC_NETWORK_IO 11,152,454 38,577,341 108,169,108
SOS_SCHEDULER_YIELD 43,284,376 86,780,278 30,253,004
WRITELOG 4,827,714 6,318,991 3,237,034
LCK_M_X 16,667,153 76,722,415 519
RESOURCE_SEMAPHORE_QUERY_COMPILE 11,481,264 51,267,713
THREADPOOL 1,342,297 32,104,862 2,538
PAGELATCH_EX 2,198,387 7,075,712 450,416
PAGELATCH_SH 799,245 4,368,679 99,608
LCK_M_S 167,478 199,832 114,758
LCK_M_U 122,167 143,708 75,866
29. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
NUMANode 8 論理 CPU 以上の稼働環境
• 2015 / 3 / 22 SQL Server CSS チームが BLOG
を発表
− http://blogs.msdn.com/b/psssql/archive/2015/03/02/
running-sql-server-on-machines-with-more-than-8-
cpus-per-numa-node-may-need-trace-flag-
8048.aspx
− SQL Server 2008 / 2008 R2 / 2012 / 2014 で稼働中
の場合、トレースフラグ T8048 設定を推奨する
− sys.dm_os_waitstats CMEMTHREAD 待ち事象が高い値
を示している場合
− sys.dm_os_spinlock_ststs sos_suspend_queue が高い値
を示している場合
• 今回は、2015 / 1 / 19 – 30 検証実施のために
未確認
30. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
検証結果のまとめ
• SQL Server 2014 上で、従来機種と比較して、
最大 2.33 倍の相対的な処理能力が検証できた
ことは、競合他社からの移行に十分対応できる
• 二つの nPartitions に分割し、2 セット上にた
すき掛けされた環境上の、冗長化構成 (SQL
Server Always On) は、高いハードウエア信頼
性と処理能力を両立可能な環境といえる
• ストレージサブシステムは、SSD フラッシュ
による I/O 負荷分散が効果的である
• 第一号ユーザ SBI リクイディティマーケッ様
にて2 セット冗長化構成で導入中
− SBI 証券 : 4 ブレード
− SBI FX トレード : 2 ブレード
31. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
SDR (Software Design Review) とは
• 目的
− SQL Server 次期リリースへのユーザニーズ収集と
優先度の確定
− 前回は、Hekaton V1 を対象に、2012 / 6 / 5 – 6 / 7
Redmond にて、熊澤、 CAT 多田、PFE 平山が出
席した。
− SBILM FX 取引システムにて Hekaton TAP を実施し、
SQL Server 2012 で世界に先駆けて稼働した
• 参加対象
− 米国と欧州を中心とした SQL Server エンドユーザ
と ISV 、コンサルファーム
• 今回の開催
− 2015/2/24 – 2/26 Redmond Campus
− Owner
− SQL Server R&D GM Shawn Bice
32. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
今回の主な SDR 出席者 (約 50 名)
• エンドユーザ
− 金融
− Citi Bank / Key Bank / US Bank / Sun Trust
− 流通
− target
− その他
− Harvard University / Expedia
• IHV
− HP / DELL
• ISV
− SAP / Salesforce / 他
• コンサル系
− Avanade
33. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
セッション内容
34. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
SQL Server 2016 アーキテクチャ
• ハイパースケール
• エンタープライズ グレード
− 企業内のセキュリティ要件に対応
• ハイブリッド
− Azure & On-Pre
− BI & OLTP
35. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
In-Memory OLTP v2
• SQL Server 2014 In-memory OLTP はなぜ本稼
働実績が少ないのか?
− 使用できる T-SQL が限定されており、新規開発で
限定的な範囲しか利用できなかった
• SQL Server 2016
− Query 機能制限の撤廃
− 現行アプリケーションの移行可能性の向上
− スケーリングの向上
− NUMA & 4 ソケット 2TB メモリー
− Always On 構成で1GB / Sec のトランザクションログ生
成が可能となる
− ツール関連の整備
• メモリー最適化テーブルと更新可能な
非クラスタ化カラムストアインデックスの統合
− リアルタイム DWH として活用可能
36. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Clustered ColumnStore Index v2
• CCSI スキャン処理の改善
− キーのピンポイント検索と範囲検索処理能力の向上
• 大量データの Insert / Marge 処理能力の向上
− ロック粒度の見直しと並列処理の導入
• PK / FK のサポート
• オンラインインデックス構築のサポート
• RCSI のサポート
• 新たな DMVs の提供によるトラブル
シューティング機能の充実
− sys.dm_db_column_store_row_group_physical_stats
− sys.dm_db_column_store_row_group_operationak_stats
− sys.dm_db_column_store_object_pool
− sys.dm_db_index_physical_stats
− sys.dm_db_index_operational_stats
− sys.column_store_row_groups
37. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
DWH and Operational Analytics
• 複数の組み合わせシナリオ
− Clustered Index +
Updatable Non-clustered ColumnStore
− In-memory OLTP Table +
Updatable Non-clustered ColumnStore
− Clustered ColumnStore Index + Non-clustered
Index
38. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
クエリー・オプティマイザの役割
リレーショナルエンジン
SQL クエリーを、効率の良い実行プランに変換する
クエリー
実行
エンジン
クエリー
オプティマイザーパーサーSQL クエリー
Logical
operator tree
Physical
operator tree
ロジカルオペレータ
例 : union / selection / project /
join / grouping
フィジカルオペレータ
例 : nested loop join / sort-merge
join / hash join / index join
39. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
生成された実行プラン
• TPC-H Query 8
SQL Server 2008 R2
• 90,000 種類のクエリーから作成
− L_ExtendedPrice と S_AcctBal それぞ
れ300の異なる値を代入
• 204 種類の異なる実行プランを生成
• [0,20:0,20] の範囲を拡大
40. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
SQL Server 運用上の悩み
• 複雑なクエリーでは数百万通りの組合せが
存在する
• 統計情報の自動更新等により突然処理時間
が変動する
• 従来は、ヒント句プランガイドで対応した
ただし、保守性が低下する
• サーバー再起動によりプランが変わる
• 定期的なインデックス再構築によりプラン
が変わる
41. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Query Store : これらの解決のために
• クエリーごとに生成された実行プランを
履歴として保存する
• 各プランごとの実行時間と I/O 統計情報を
記録する
• 最も実行効率の良いクエリーを特定する
• 最適なクエリープランを固定化 ( Force )
する
• これらの作業を、サーバー再起動時、SQL
Server アップグレード、H/W 構成変更時、
クエリーのリコンパイル時に実行する
42. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Query Store とは
• ユーザデータベース内に存在し、実行済み
クエリーとクエリーの実行履歴を保持する
Compile
Execute
SQL
Plan Store
Runtime
Stats
Query Store
Query
Store
Schema
Compile
Message
Execute
Message
非同期
書き込み
DB Option
DATA_FLASH_INTERVAL_SECONDS
43. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Query Store Schema 構造
Query
_text
Query Plan
Runtime
_stats
1:n 1:n 1:n
Context
settings
Runtime
_stats
Interval
Select * from T1
Query text +
ANSI NULLs ON/OFF
Clustered
Index Scan
Avg Duration
10 Seconds
One row / IntervalOne row
/ Set Option 組合せ
44. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
提供される DMVs とツール
• DMVs
− select * from sys.query_store_query_text
− select * from sys.query_store_query
− select * from sys.query_store_plan
− select * from sys.query_store_runtime_stats order by
runtime_stats_id
− select * from sys.query_store_runtime_stats_interval
− select * from sys.query_context_settings
− select * from sys.database_query_store_options
• 運用保守ツール
− sp_query_store_flush_db
− sp_query_store_force_plan
− sp_query_store_remove_plan
− sp_query_store_remove_query
− sp_query_store_reset_exec_stats
− sp_query_store_unforce_plan
45. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
運用とセッティング
• テスト環境で作成したデータベースを、
本稼働環境にコピーし、attach でクエリー
ストアを移行することが可能
• SSMS からクエリーストア関連の UI を設定
可能
− Alter database current Set QUERY_Store = ON
| OFF | CLEAR
− set query_store (operation_mode = read_only |
read_write)
− time interval
− データが一杯になった時の処理
• クエリーストアサイズの上限設定が可能
46. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Query Store properties
47. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Query Store に記録される内容
• Query Text
• Query Plan
• Runtime Stats
(単位時間ごとに記録 : 既定値 1 時間)
− プランの実行回数
− 保存されるデータ
− duration / cpu_time / logical_io_read /
logical_io_write / physical_io_read /
physical_io_write / DOP / query_max_used_memory
/ rowcount
− 各データごとの、平均値、最大値、最小値、
最終実行時間
− Query 実行終了時に記録する
48. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
sys.query_store_runtime_stats 実行結果
runtime_stats_
id
plan_
id
avg_
duration last_duration
min_
duration
max_
duration
avg_cpu_
time
last_cpu_
time
min_cpu_
time
max_cpu_
time avg_rowcount last_rowcount min_rowcount
54 40 49,634 49,634 49,634 49,634 1,283 1,283 1,283 1,283 2 2 2
55 41 2,318,223 2,318,223 2,318,223 2,318,223 51,075 51,075 51,075 51,075 45,124 45,124 45,124
57 43 475,271 475,271 475,271 475,271 193,287 193,287 193,287 193,287 45,124 45,124 45,124
49. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
SQL Server 2016 CTP 2 Demo
DECLARE @OrderFrom int
DECLARE @OrderTo int
SET @OrderFrom = 10248
SET @OrderTO = 10251
EXECUTE [dbo].[getorderorderid] @OrderFrom, @Ordero
WITH RECOMPILE
GO
DECLARE @OrderFrom int
DECLARE @OrderTo int
SET @OrderFrom = 10248
SET @OrderTO = 55373
EXECUTE [dbo].[getorderorderid] @OrderFrom, @OrderTo
WITH RECOMPILE
GO
SELECT Txt.query_text_id, Txt.query_sql_text, Pl.plan_id, Qry.*
FROM sys.query_store_plan AS Pl
JOIN sys.query_store_query AS Qry
ON Pl.query_id = Qry.query_id
JOIN sys.query_store_query_text AS Txt
ON Qry.query_text_id = Txt.query_text_id ;
EXEC sp_query_store_force_plan 2, 2;
50. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Index Seek + Key Lookup によるプラン
51. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
Index Scan によるプラン
52. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
DMVs による Query Store 検索
53. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
常に優先する実行プランの選択
54. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
優先実行されるプランを保持
55. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
従来の Index Scan Query を再実行
56. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
リソース利用状況の表示
57. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.
今後の予定
• Public CTP2
− 2015 / 5 / 27
− 今後二か月毎に
更新ビルドを提供
• Public CTP3
− Future Complete
− 2015 / Autumn
• RTM
− SQL Server 2016
− 2016 / Summer
58. © 2015 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.
Microsoft makes no warranties, express or implied in this presentation.