2. 設立: 2017年7月4日(火)
拠点: 品川区西大井1-1-2-206(西大井創業支援センター内)
事業内容:
✓ 高性能データ処理ソフトウェアの開発と販売
✓ GPU&DB領域の技術コンサルティング
自己紹介
海外 浩平 (KaiGai Kohei)
Chief Architect & CEO of HeteroDB
PostgreSQL, Linux kernel 開発者 (2003~)
PG-Stromのメイン開発者(2012~)
興味範囲:Big-data, GPU, NVME, PMEM, …
about myself
about our company
PG-Strom
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?2
3. PG-Stromとは?
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?3
【機能】
集計/解析ワークロードの透過的なGPU高速化
SQLからGPUプログラムを自動生成し並列実行
SSD-to-GPU Direct SQLによるPCIeバスレベルの最適化
列ストレージによるI/Oと並列計算の効率化
PG-Strom: GPUとNVMEの能力を最大限に引き出し、数十TB単位の
データ処理を高速化するPostgreSQL向け拡張モジュール
App
GPU
off-loading
for IoT/Big-Data
for ML/Analytics
➢ SSD-to-GPU Direct SQL
➢ Columnar Store (Arrow_Fdw)
➢ Asymmetric Partition-wise
JOIN/GROUP BY
➢ BRIN-Index Support
➢ NVME-over-Fabric Support
➢ Procedural Language for
GPU native code (PL/CUDA)
➢ NVIDIA RAPIDS data frame
support (WIP)
➢ IPC on GPU device memory
4. PG-Strom as an Open Source Project
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?4
公式ドキュメント(英/日)
http://heterodb.github.io/pg-strom/
★がいっぱい ☺
GPL-v2.0で配布
2012年から継続して開発
▌対応するPostgreSQLバージョン
PostgreSQL v11.x, v10.x
▌関連するPostgreSQL本体機能の強化
Writable FDW support (9.3)
Custom-Scan interface (9.5)
FDW and Custom-Scan JOIN pushdown (9.5)
▌PostgreSQLコミュニティイベントでの発表
PGconf.EU 2012 (Prague), 2015 (Vienna), 2018 (Lisbon)
PGconf.ASIA 2018 (Tokyo), 2019 (Bali, Indonesia)
PGconf.SV 2016 (San Francisco)
PGconf.China 2015 (Beijing)
22. Apache Arrowとは(2/2)– データ型のマッピング
Apache Arrowデータ型 PostgreSQLデータ型 補足説明
Int int2, int4, int8
FloatingPoint float2, float4, float8 float2 is an enhancement of PG-Strom
Binary bytea
Utf8 text
Bool bool
Decimal numeric
Date date adjusted to unitsz = Day
Time time adjusted to unitsz = MicroSecond
Timestamp timestamp adjusted to unitsz = MicroSecond
Interval interval
List array types Only 1-dimensional array is supportable
Struct composite types
Union ------
FixedSizeBinary char(n)
FixedSizeList array tyoes?
Map ------
大半のデータ型はApache Arrow PostgreSQLの間で変換可能
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?22
23. 《背景》データはどこで生成されるのか?
ETL
OLTP OLAP
伝統的なOLTP&OLAPシステム - データはDBシステムの内側で生成される
Data
Creation
IoT/M2M時代 - データはDBシステムの外側で生成される
Log
processing
BI Tools
BI Tools
Gateway Server
Data
Creation
Data
Creation
Many Devices
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?23
DBシステムへのデータのインポートが、集計処理以上に時間のかかる処理に!
Data
Import
Import!
30. Arrowファイルの生成
✓ 基本的な使い方は、-cで指定したSQLの実行結果を、
-oで指定したファイルに書き出す。
$./pg2arrow -h
Usage:
pg2arrow [OPTION]... [DBNAME [USERNAME]]
General options:
-d, --dbname=DBNAME database name to connect to
-c, --command=COMMAND SQL command to run
-f, --file=FILENAME SQL command from file
-o, --output=FILENAME result file in Apache Arrow format
Arrow format options:
-s, --segment-size=SIZE size of record batch for each
(default is 256MB)
Connection options:
-h, --host=HOSTNAME database server host
-p, --port=PORT database server port
-U, --username=USERNAME database user name
-w, --no-password never prompt for password
-W, --password force password prompt
Debug options:
--dump=FILENAME dump information of arrow file
--progress shows progress of the job.
Pg2Arrow により、SQL実行結果をArrow形式で書き出す事ができる。
Apache Arrow
Data Files
Arrow_Fdw
Pg2Arrow
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?30
36. PCIeバスレベルの最適化(3/5)
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?36
PCIe-switch経由のP2P DMAは、完全にCPUをバイパスする事ができる
CPU CPU
PCIe
switch
SSD GPU
PCIe
switch
SSD GPU
PCIe
switch
SSD GPU
PCIe
switch
SSD GPU
SCAN SCAN SCAN SCAN
JOIN JOIN JOIN JOIN
GROUP BY GROUP BY GROUP BY GROUP BY
Pre-processed Data (very small)
GATHER GATHER
37. PCIeバスレベルの最適化(4/5)
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?37
Supermicro
SYS-4029TRT2
x96 lane
PCIe
switch
x96 lane
PCIe
switch
CPU2 CPU1
QPI
Gen3
x16
Gen3 x16
for each
slot
Gen3 x16
for each
slotGen3
x16
▌HPC Server – optimization for GPUDirect RDMA
▌I/O Expansion Box
NEC ExpEther 40G
(4slots edition)
Network
Switch
4 slots of
PCIe Gen3 x8
PCIe
Swich
40Gb
Ethernet
CPU
NIC
Extra I/O Boxes
38. PCIeバスレベルの最適化(4/4)– Combined GPU Kernel
DB Tech Showcase/Tokyo 2019 - PostgreSQLをどこまで高速化できるのか?38
処理ステップ間でGPU~CPUをデータがピンポンするのは絶対悪
GpuScan
kernel
GpuJoin
kernel
GpuPreAgg
kernel
GPU
CPU
Storage
GPU
Buffer
GPU
Buffer
results
DMA
Buffer
Agg
(PostgreSQL)
Combined GPU kernel for SCAN + JOIN + GROUP BY
data size
= Large
data size
= Small
DMA
Buffer
SSD-to-GPU
Direct SQL
DMA
Buffer
No data transfer ping-pong