SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Report from the field on Aurora PostgreSQL
Performance
T a t s u o I s h i i ,
J a p a n P r e s i d e n t
S R A O S S , I n c .
M a r k P o r t e r
G e n e r a l M a n a g e r
A m a z o n R D S , A u r o r a , R D S f o r P o s t g r e S Q L
DAT 316
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Introduction to Aurora PostgreSQL
• Performance Results from SRA OSS
• Aurora Architecture
• Pgpool-II Announcement
• Performance Insights
• Q&A
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Introduction to Aurora PostgreSQL
• Performance Results from SRA OSS
• Aurora Architecture
• Pgpool-II Announcement
• Performance Insights
• Q&A
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Reimagining the relational database
What if you were inventing the database today?
You would break apart the stack
You would build something that:
 Can scale out…
 Is self-healing…
 Leverages distributed services…
You would use open source software
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A service-oriented architecture applied to the
database
Move the logging and storage layer into a
multitenant, scale-out, database-optimized
storage service
Integrate with other AWS services like
Amazon EC2, Amazon VPC, Amazon
DynamoDB, Amazon SWF, and Amazon
Route 53 for control and monitoring
Make it a managed service—using Amazon
RDS; takes care of management and
administrative functions
Amazon
DynamoDB
Amazon SWF
Amazon Route 53
Logging + Storage
SQL
Transactions
Caching
Amazon S3
1
2
3
Amazon RDS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why PostgreSQL ?
• Open source database
• In active development for 20 years
• Owned by a foundation, not a single company
• Permissive innovation-friendly open source license
• High performance out of the box
• Object-oriented and ANSI-SQL:2008 compatible
• Most geospatial features of any open source database
• Supports stored procedures in 12 languages (Java, Perl,
Python, Ruby, Tcl, C/C++, its own Oracle-like PL/pgSQL, etc.)
• Most Oracle-compatible open source database
• Highest AWS Schema Conversion Tool automatic conversion
rates are from Oracle to PostgreSQL
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
In 2014, we launched Amazon Aurora MySQL
Now we have added PostgreSQL compatibility—creating
Amazon Aurora PostgreSQL
Customers can now choose how to use Amazon’s
cloud-optimized relational database, with the performance and
availability of commercial databases and the simplicity and
cost-effectiveness of open source databases
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Introduction to Aurora PostgreSQL
• Performance Results from SRA OSS
• Aurora Architecture
• Pgpool-II Announcement
• Performance Insights
• Q&A
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora PostgreSQL
db.r3.8xlarge
vCPU 32 mem 244GB
Multi-AZ
Environment
Amazon RDS for PostgreSQL
db.r3.8xlarge
vCPU 32, mem 244GB
Provisioned IOPS 10,000
Multi-AZ
 Using same #CPU and memory size between Aurora and RDS
 Using 10,000 Provisioned IOPS storage to set the same price with Aurora per hour
 Using PostgreSQL 9.6.2 on both
AZ2
AZ1
AZ2
AZ1
Write
&
Read
Multi-AZ
(Backup)
Client
Amazon EC2 m4.10xlarge
vCPU 40, mem 160GB
pgbench
Read
Only
Write
&
Read
Multi-AZ
(Backup)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scenario
• Using pbench
• 250, 500, 750, and 1,000 connections
• Loading data, creating index, and executing vacuum for each test
• DB size is 30 GB and large table contains 200 million rows
• Executing one SELECT, three UPDATE, and one INSERT within a transaction
for NUM in 250 500 750 1000
do
#Initialization
pgbench -i -s 2000
#Benchmark
pgbench --progress=1 --protocol=prepared -T 3600 -r -c $NUM -j $NUM -s 2000
done
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Loading Data
0:00:00
0:02:53
0:05:46
0:08:38
0:11:31
0:14:24
0:17:17
0:20:10
copy vacuum index 合計
Aurora
RDS
Total
Avg. of 4 tests
GoodElapsedTime
1/2 3/4
1/3
1/8
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Throughput
2000
4000
6000
8000
10000
12000
14000
16000
18000
20000
250 500 750 1000
Aurora
RDS
Connections
GoodTPS
x1.7
x2.2 x2.7 x3
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Average wait time of transactions
0
500
1000
1500
2000
2500
1 301 601 901 1201 1501 1801 2101 2401 2701 3001 3301
0
500
1000
1500
2000
2500
1 301 601 901 1201 1501 1801 2101 2401 2701 3001 3301
Elapsed seconds with 1,000 connections
Elapsed seconds with 1,000 connections
Aurora
RDS
msmsGoodGood
0
20
40
60
80
1 61 121 181 241 301
0
500
1000
1500
2000
2500
1 61 121 181 241 301
Elapsed seconds + 1,800 sec
Elapsed seconds + 1,800 sec
Aurora is more stable!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Comparison of CPU utilization
• CPU Utilization on CloudWatch (1,000 connections)
• Aurora uses CPU more efficiently than RDS
# IO waits consume CPU time on RDS
Aurora RDS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Comparison of Write IOPS (count/second)
• Write IOPS on CloudWatch
• Write IOPS of Aurora is lower than RDS
This means Aurora is handling writes more efficiently
Aurora RDS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Comparison of Replica Lag
• Adding slave for read on RDS to compare streaming replication on RDS and Aurora’s replication
• Replica Lag on Aurora was low and replication was finished within tens of milliseconds
• Streaming replication on RDS could not catch up within the benchmark
Aurora RDS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Summary
Compared to RDS, Amazon Aurora PostgreSQL is:
• 3 times faster on data loading
• 3 times faster on throughput
• Quick and stable response
• No performance degradation with increasing connections
• Low replica lag on replication
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Introduction to Aurora PostgreSQL
• Performance Results from SRA OSS
• Aurora Architecture
• Pgpool-II Announcement
• Performance Insights
• Q&A
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora PostgreSQL
Performance Architecture
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Do fewer IOs
Minimize network packets
Offload the database engine
DO LESS WORK
Process asynchronously
Reduce latency path
Use lock-free data structures
Batch operations together
BE MORE EFFICIENT
How does Amazon Aurora achieve high performance?
DATABASES ARE ALL ABOUT I/O
NETWORK-ATTACHED STORAGE IS ALL ABOUT PACKETS/SECOND
HIGH-THROUGHPUT PROCESSING NEEDS CPU AND MEMORY OPTIMIZATIONS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Write IO Traffic in an Amazon Aurora database node
AZ 1 AZ 3
Primary
Database
Node
Amazon S3
AZ 2
Read
Replica/
Secondary
Node
AMAZON AURORA
ASYNC
4/6 QUORUM
DISTRIBUTED
WRITES
DATAAMAZON AURORA + WAL LOG COMMIT LOG & FILES
IO FLOW
Only write WAL records; all steps asynchronous
No data block writes (checkpoint, cache replacement)
6X more log writes, but 9X less network traffic
Tolerant of network and storage outlier latency
OBSERVATIONS
2x or better PostgreSQL Community Edition performance on
write-only or mixed read-write workloads
PERFORMANCE
Boxcar log records—fully ordered by LSN
Shuffle to appropriate segments—partially ordered
Boxcar to storage nodes and issue writes
WAL
T Y P E O F W R IT E
Read
Replica/
Secondary
Node
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IO Traffic in Aurora Replicas
Physical: Ship redo (WAL) to Replica
Write workload similar on both instances
Independent, duplicated storage
Heavy write load impairs read performance
PAGE CACHE
UPDATE
Aurora Master
30% Read
70% Write
Aurora Replica
100% New Reads
Shared Multi-AZ Storage
PostgreSQL Master
30% Read
70% Write
PostgreSQL Replica
30% New Reads
70% Write
SINGLE-THREADED
WAL APPLY
Data Volume Data Volume
Physical: Ship redo (WAL) from Master to Replica
Cached pages have redo applied
Replica shares storage: no writes performed
Replica can do more read work
Advance read view as commits seen from master
POSTGRESQL READ SCALING AMAZON AURORA READ SCALING
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Write IO Traffic in an Amazon Aurora storage node
LOG RECORDS
Primary
Database
Node
INCOMING QUEUE
STORAGE NODE
AMAZON S3 BACKUP
1
2
3
4
5
6
7
8
UPDATE
QUEUE
ACK
HOT
LOG
DATA
BLOCKS
POINT IN TIME
SNAPSHOT
GC
SCRUB
COALESCE
SORT
GROUP
PEER-TO-
PEER
GOSSIPPeer
Storage
Nodes
All steps are asynchronous
Only steps 1 and 2 are in foreground latency path
Input queue is far smaller than PostgreSQL
Favors latency-sensitive operations
Uses disk space to buffer against spikes in activity
OBSERVATIONS
IO FLOW
① Receive record and add to in-memory queue
② Persist record and acknowledge
③ Organize records and identify gaps in log
④ Gossip with peers to fill in holes
⑤ Coalesce log records into new data block versions
⑥ Periodically stage log and new block versions to
Amazon S3
⑦ Periodically garbage-collect old versions
⑧ Periodically validate CRC codes on blocks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora PostgreSQL
Durability and Availability
Architecture
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora storage engine overview
Data is replicated 6 times across 3 Availability
Zones
Continuous backup to Amazon S3
(built for 11 9s durability)
Continuous monitoring of nodes and disks for
repair
10 GB segments as unit of repair or hotspot
rebalance
Quorum system for read/write; latency tolerant
Quorum membership changes do not stall writes
Storage volume automatically grows up to 64 TB
AZ 1 AZ 2 AZ 3
Amazon S3
Database
Node
Storage
Node
Storage
Node
Storage
Node
Storage
Node
Storage
Node
Storage
Node
Storage
Monitoring
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scale-out, distributed, log structured storage
Master Replica Replica Replica
Availability Zone 1
Shared Storage Volume—Transaction Aware
Primary
Database
Node
Read
Replica/
Secondary
Node
Read
Replica/
Secondary
Node
Read
Replica/
Secondary
Node
Availability Zone 2 Availability Zone 3
AWS Region
Storage
Monitoring
Database and
Instance
Monitoring
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What can fail?
Segment failures (disks)
Node failures (machines)
AZ failures (network or datacenter)
Optimizations
4 out of 6 write quorum
3 out of 6 read quorum
Peer-to-peer replication for repairs
Amazon Aurora Storage fault tolerance
SQL
Transaction
AZ 1 AZ 2 AZ 3
Caching
SQL
Transaction
AZ 1 AZ 2 AZ 3
Caching
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora Replicas
Availability
Failing database nodes are automatically
detected and replaced
Failing database processes are
automatically detected and recycled
Replicas are automatically promoted to
primary if needed (failover)
Customer specifiable failover order
AZ 1 AZ 3AZ 2
Primary
Node
Primary
Node
Primary
Database
Node
Primary
Node
Primary
Node
Read
Replica
Primary
Node
Primary
Node
Read
Replica
Database
and
Instance
Monitoring
Performance
Customer applications can scale out read traffic
across read replicas
Read balancing across read replicas
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Faster, more predictable failover with Amazon Aurora
App
RunningFailure Detection DNS Propagation
Recovery
Database
Failure
Amazon RDS for PostgreSQL is good: failover times of ~60 seconds
Replica-Aware App Running
Failure Detection DNS Propagation
Recovery
Database
Failure
Amazon Aurora is better: failover times < 30 seconds
1 5 - 2 0 s e c 3 - 1 0 s e c
App
Running
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Introduction to Aurora PostgreSQL
• Performance Results from SRA OSS
• Aurora Architecture
• Pgpool-II Announcement
• Performance Insights
• Q&A
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Introducing Pgpool-II
• Providing clustering features between application and PostgreSQL
• Normally, Pgpool-II is used with PostgreSQL’s streaming replication
• Open Source Software (BSD License)
• Major version up per year
• Latest version is 3.7
PostgreSQL
Pgpool-IIClient
Read/Write
Query
Write
Primary
Standby
Standby
Replication
Read
Read
Pgpool-II details
pgpool.net/mediawiki/index.php/Main_Page
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WE ARE ANNOUNCING…
Pgpool-II 3.7 supports Amazon Aurora PostgreSQL and provides:
• Automatic distribution of queries (UPDATE for master, SELECT
for read replica)
• Connection pooling and query cache
• Configuration sample is included
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Introduction to Aurora PostgreSQL
• Performance Results from SRA OSS
• Aurora Architecture
• Pgpool-II Announcement
• Performance Insights
• Q&A
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is RDS Performance Insights?
Customers ask for
• Visibility into performance of RDS databases
• Want to optimize cloud database workloads
• Easy tool
• Often only part-time DBA or no DBA
• Single pane of glass
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
First Step: RDS Enhanced Monitoring
Released 2016
OS Metrics
Process/thread list
Up to 1 second granularity
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Introducing: RDS Performance Insights
Dashboard
• DB load
• Adjustable timeframe
• Filterable by attribute (SQL, User, Host, Wait)
• SQL causing load
Phased RDS delivery
• Aurora, MySQL/MariaDB, PostgreSQL, Oracle, SQL Server
Guided discovery of performance problems
• For both beginners and experts
• Core metric is “Database Load”
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is “Database Load?”
All engines have a connections list showing
• Active
• Idle
We sample every second
• For each active session, collect
• SQL,
• State :CPU, I/O, Lock, Commit log wait, etc.
• Host
• User
Expose as “Average Active Sessions” (AAS)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS Performance Insights dashboard
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS Performance Insights
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Sampling Every Second
Query run often
Fast query, run rarely
Slow query
User 1
User 2
User 3
Time
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Sampling is like film
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AAS load graph
User 1
User 2
User 3
User 4
Active Sessions
=
1
2
3
4
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Active Session State
CPU IO Wait
idleidle idle idleQuery 1 Query 2 Query 3
Time
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AAS over 1 minute averages
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Access to RDS Performance Insights
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Access to RDS Performance Insights
High
Load
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Summary: Amazon RDS Performance Insights
 DB Load: Average Active Sessions
 Identifies database bottlenecks
 Easy
 Powerful
 Top SQL
 Identifies source of bottleneck
 Enables problem discovery
 Adjustable timeframe
 Hour, day, week, and longer
 Questions:
 rdspi@amazon.com
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Introduction to Aurora PostgreSQL
• Performance Results from SRA OSS
• Aurora Architecture
• Pgpool-II Announcement
• Performance Insights
• Questions?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THANK YOU!
T a t s u o I s h i i ,
J a p a n P r e s i d e n t
S R A O S S , I n c .
M a r k P o r t e r
G e n e r a l M a n a g e r
A m a z o n R D S , A u r o r a , R D S f o r P o s t g r e S Q L
(And pl ease fi l l out your sessi on revi ews)

Contenu connexe

Tendances

Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会
Masahiko Sawada
 
PostgreSQLの範囲型と排他制約
PostgreSQLの範囲型と排他制約PostgreSQLの範囲型と排他制約
PostgreSQLの範囲型と排他制約
Akio Ishida
 

Tendances (20)

マイクロサービスに至る歴史とこれから - XP祭り2021
マイクロサービスに至る歴史とこれから - XP祭り2021マイクロサービスに至る歴史とこれから - XP祭り2021
マイクロサービスに至る歴史とこれから - XP祭り2021
 
AWSメンテナンス ElastiCache編
AWSメンテナンス ElastiCache編AWSメンテナンス ElastiCache編
AWSメンテナンス ElastiCache編
 
Memoizeの仕組み(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
Memoizeの仕組み(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)Memoizeの仕組み(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
Memoizeの仕組み(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...
Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...
Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
 
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
PostgreSQLによるデータ分析ことはじめ
PostgreSQLによるデータ分析ことはじめPostgreSQLによるデータ分析ことはじめ
PostgreSQLによるデータ分析ことはじめ
 
Spring Boot の Web アプリケーションを Docker に載せて AWS ECS で動かしている話
Spring Boot の Web アプリケーションを Docker に載せて AWS ECS で動かしている話Spring Boot の Web アプリケーションを Docker に載せて AWS ECS で動かしている話
Spring Boot の Web アプリケーションを Docker に載せて AWS ECS で動かしている話
 
ブレソルでテラバイト級データのALTERを短時間で終わらせる
ブレソルでテラバイト級データのALTERを短時間で終わらせるブレソルでテラバイト級データのALTERを短時間で終わらせる
ブレソルでテラバイト級データのALTERを短時間で終わらせる
 
Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会
 
PySparkによるジョブを、より速く、よりスケーラブルに実行するための最善の方法 ※講演は翻訳資料にて行います。 - Getting the Best...
PySparkによるジョブを、より速く、よりスケーラブルに実行するための最善の方法  ※講演は翻訳資料にて行います。 - Getting the Best...PySparkによるジョブを、より速く、よりスケーラブルに実行するための最善の方法  ※講演は翻訳資料にて行います。 - Getting the Best...
PySparkによるジョブを、より速く、よりスケーラブルに実行するための最善の方法 ※講演は翻訳資料にて行います。 - Getting the Best...
 
MySQLチューニング
MySQLチューニングMySQLチューニング
MySQLチューニング
 
binary log と 2PC と Group Commit
binary log と 2PC と Group Commitbinary log と 2PC と Group Commit
binary log と 2PC と Group Commit
 
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
 
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
 
PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選
 
PostgreSQL14の pg_stat_statements 改善(第23回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL14の pg_stat_statements 改善(第23回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL14の pg_stat_statements 改善(第23回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL14の pg_stat_statements 改善(第23回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
PostgreSQLの範囲型と排他制約
PostgreSQLの範囲型と排他制約PostgreSQLの範囲型と排他制約
PostgreSQLの範囲型と排他制約
 
DeNAのQCTマネジメント IaaS利用のベストプラクティス [AWS Summit Tokyo 2019]
DeNAのQCTマネジメント IaaS利用のベストプラクティス [AWS Summit Tokyo 2019]DeNAのQCTマネジメント IaaS利用のベストプラクティス [AWS Summit Tokyo 2019]
DeNAのQCTマネジメント IaaS利用のベストプラクティス [AWS Summit Tokyo 2019]
 
AWS Black Belt Online Seminar Amazon Aurora
AWS Black Belt Online Seminar Amazon AuroraAWS Black Belt Online Seminar Amazon Aurora
AWS Black Belt Online Seminar Amazon Aurora
 

Similaire à DAT316_Report from the field on Aurora PostgreSQL Performance

DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
Amazon Web Services
 
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_SingaporeDeep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Amazon Web Services
 

Similaire à DAT316_Report from the field on Aurora PostgreSQL Performance (20)

Amazon Aurora 深度探討
Amazon Aurora 深度探討Amazon Aurora 深度探討
Amazon Aurora 深度探討
 
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
Case Study: Sprinklr Uses Amazon EBS to Maximize Its NoSQL Deployment - DAT33...
 
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
 
Amazon Aurora (MySQL, Postgres)
Amazon Aurora (MySQL, Postgres)Amazon Aurora (MySQL, Postgres)
Amazon Aurora (MySQL, Postgres)
 
DAT304_Amazon Aurora Performance Optimization with MySQL
DAT304_Amazon Aurora Performance Optimization with MySQLDAT304_Amazon Aurora Performance Optimization with MySQL
DAT304_Amazon Aurora Performance Optimization with MySQL
 
Scale Up and Modernize Your Database with Amazon Relational Database Service ...
Scale Up and Modernize Your Database with Amazon Relational Database Service ...Scale Up and Modernize Your Database with Amazon Relational Database Service ...
Scale Up and Modernize Your Database with Amazon Relational Database Service ...
 
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech TalksIntroducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
 
DAT332_How Verizon is Adopting Amazon Aurora PostgreSQL for Enterprise Workloads
DAT332_How Verizon is Adopting Amazon Aurora PostgreSQL for Enterprise WorkloadsDAT332_How Verizon is Adopting Amazon Aurora PostgreSQL for Enterprise Workloads
DAT332_How Verizon is Adopting Amazon Aurora PostgreSQL for Enterprise Workloads
 
Amazon Aurora: Deep Dive - SRV308 - Chicago AWS Summit
Amazon Aurora: Deep Dive - SRV308 - Chicago AWS SummitAmazon Aurora: Deep Dive - SRV308 - Chicago AWS Summit
Amazon Aurora: Deep Dive - SRV308 - Chicago AWS Summit
 
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
Migrating Your Oracle & SQL Server Databases to Amazon Aurora (DAT318) - AWS ...
 
Amazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration ServiceAmazon Aurora and AWS Database Migration Service
Amazon Aurora and AWS Database Migration Service
 
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_SingaporeDeep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
Deep Dive - Amazon Relational Database Services_AWSPSSummit_Singapore
 
What's new in Amazon Aurora - ADB203 - Chicago AWS Summit
What's new in Amazon Aurora - ADB203 - Chicago AWS SummitWhat's new in Amazon Aurora - ADB203 - Chicago AWS Summit
What's new in Amazon Aurora - ADB203 - Chicago AWS Summit
 
SQL Server on AWS
SQL Server on AWSSQL Server on AWS
SQL Server on AWS
 
Use AWS DMS to Securely Migrate Your Oracle Database to Amazon Aurora with Mi...
Use AWS DMS to Securely Migrate Your Oracle Database to Amazon Aurora with Mi...Use AWS DMS to Securely Migrate Your Oracle Database to Amazon Aurora with Mi...
Use AWS DMS to Securely Migrate Your Oracle Database to Amazon Aurora with Mi...
 
PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
Amazon Aurora_Deep Dive
Amazon Aurora_Deep DiveAmazon Aurora_Deep Dive
Amazon Aurora_Deep Dive
 
DAT309_Best Practices for Migrating from Oracle and SQL Server to Amazon RDS
DAT309_Best Practices for Migrating from Oracle and SQL Server to Amazon RDSDAT309_Best Practices for Migrating from Oracle and SQL Server to Amazon RDS
DAT309_Best Practices for Migrating from Oracle and SQL Server to Amazon RDS
 
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon AuroraNEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
 

Plus de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Plus de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

DAT316_Report from the field on Aurora PostgreSQL Performance

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Report from the field on Aurora PostgreSQL Performance T a t s u o I s h i i , J a p a n P r e s i d e n t S R A O S S , I n c . M a r k P o r t e r G e n e r a l M a n a g e r A m a z o n R D S , A u r o r a , R D S f o r P o s t g r e S Q L DAT 316
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Introduction to Aurora PostgreSQL • Performance Results from SRA OSS • Aurora Architecture • Pgpool-II Announcement • Performance Insights • Q&A
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Introduction to Aurora PostgreSQL • Performance Results from SRA OSS • Aurora Architecture • Pgpool-II Announcement • Performance Insights • Q&A
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Reimagining the relational database What if you were inventing the database today? You would break apart the stack You would build something that:  Can scale out…  Is self-healing…  Leverages distributed services… You would use open source software
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A service-oriented architecture applied to the database Move the logging and storage layer into a multitenant, scale-out, database-optimized storage service Integrate with other AWS services like Amazon EC2, Amazon VPC, Amazon DynamoDB, Amazon SWF, and Amazon Route 53 for control and monitoring Make it a managed service—using Amazon RDS; takes care of management and administrative functions Amazon DynamoDB Amazon SWF Amazon Route 53 Logging + Storage SQL Transactions Caching Amazon S3 1 2 3 Amazon RDS
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why PostgreSQL ? • Open source database • In active development for 20 years • Owned by a foundation, not a single company • Permissive innovation-friendly open source license • High performance out of the box • Object-oriented and ANSI-SQL:2008 compatible • Most geospatial features of any open source database • Supports stored procedures in 12 languages (Java, Perl, Python, Ruby, Tcl, C/C++, its own Oracle-like PL/pgSQL, etc.) • Most Oracle-compatible open source database • Highest AWS Schema Conversion Tool automatic conversion rates are from Oracle to PostgreSQL
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. In 2014, we launched Amazon Aurora MySQL Now we have added PostgreSQL compatibility—creating Amazon Aurora PostgreSQL Customers can now choose how to use Amazon’s cloud-optimized relational database, with the performance and availability of commercial databases and the simplicity and cost-effectiveness of open source databases
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Introduction to Aurora PostgreSQL • Performance Results from SRA OSS • Aurora Architecture • Pgpool-II Announcement • Performance Insights • Q&A
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Aurora PostgreSQL db.r3.8xlarge vCPU 32 mem 244GB Multi-AZ Environment Amazon RDS for PostgreSQL db.r3.8xlarge vCPU 32, mem 244GB Provisioned IOPS 10,000 Multi-AZ  Using same #CPU and memory size between Aurora and RDS  Using 10,000 Provisioned IOPS storage to set the same price with Aurora per hour  Using PostgreSQL 9.6.2 on both AZ2 AZ1 AZ2 AZ1 Write & Read Multi-AZ (Backup) Client Amazon EC2 m4.10xlarge vCPU 40, mem 160GB pgbench Read Only Write & Read Multi-AZ (Backup)
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Scenario • Using pbench • 250, 500, 750, and 1,000 connections • Loading data, creating index, and executing vacuum for each test • DB size is 30 GB and large table contains 200 million rows • Executing one SELECT, three UPDATE, and one INSERT within a transaction for NUM in 250 500 750 1000 do #Initialization pgbench -i -s 2000 #Benchmark pgbench --progress=1 --protocol=prepared -T 3600 -r -c $NUM -j $NUM -s 2000 done
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Loading Data 0:00:00 0:02:53 0:05:46 0:08:38 0:11:31 0:14:24 0:17:17 0:20:10 copy vacuum index 合計 Aurora RDS Total Avg. of 4 tests GoodElapsedTime 1/2 3/4 1/3 1/8
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Throughput 2000 4000 6000 8000 10000 12000 14000 16000 18000 20000 250 500 750 1000 Aurora RDS Connections GoodTPS x1.7 x2.2 x2.7 x3
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Average wait time of transactions 0 500 1000 1500 2000 2500 1 301 601 901 1201 1501 1801 2101 2401 2701 3001 3301 0 500 1000 1500 2000 2500 1 301 601 901 1201 1501 1801 2101 2401 2701 3001 3301 Elapsed seconds with 1,000 connections Elapsed seconds with 1,000 connections Aurora RDS msmsGoodGood 0 20 40 60 80 1 61 121 181 241 301 0 500 1000 1500 2000 2500 1 61 121 181 241 301 Elapsed seconds + 1,800 sec Elapsed seconds + 1,800 sec Aurora is more stable!
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Comparison of CPU utilization • CPU Utilization on CloudWatch (1,000 connections) • Aurora uses CPU more efficiently than RDS # IO waits consume CPU time on RDS Aurora RDS
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Comparison of Write IOPS (count/second) • Write IOPS on CloudWatch • Write IOPS of Aurora is lower than RDS This means Aurora is handling writes more efficiently Aurora RDS
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Comparison of Replica Lag • Adding slave for read on RDS to compare streaming replication on RDS and Aurora’s replication • Replica Lag on Aurora was low and replication was finished within tens of milliseconds • Streaming replication on RDS could not catch up within the benchmark Aurora RDS
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Summary Compared to RDS, Amazon Aurora PostgreSQL is: • 3 times faster on data loading • 3 times faster on throughput • Quick and stable response • No performance degradation with increasing connections • Low replica lag on replication
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Introduction to Aurora PostgreSQL • Performance Results from SRA OSS • Aurora Architecture • Pgpool-II Announcement • Performance Insights • Q&A
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Aurora PostgreSQL Performance Architecture
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Do fewer IOs Minimize network packets Offload the database engine DO LESS WORK Process asynchronously Reduce latency path Use lock-free data structures Batch operations together BE MORE EFFICIENT How does Amazon Aurora achieve high performance? DATABASES ARE ALL ABOUT I/O NETWORK-ATTACHED STORAGE IS ALL ABOUT PACKETS/SECOND HIGH-THROUGHPUT PROCESSING NEEDS CPU AND MEMORY OPTIMIZATIONS
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Write IO Traffic in an Amazon Aurora database node AZ 1 AZ 3 Primary Database Node Amazon S3 AZ 2 Read Replica/ Secondary Node AMAZON AURORA ASYNC 4/6 QUORUM DISTRIBUTED WRITES DATAAMAZON AURORA + WAL LOG COMMIT LOG & FILES IO FLOW Only write WAL records; all steps asynchronous No data block writes (checkpoint, cache replacement) 6X more log writes, but 9X less network traffic Tolerant of network and storage outlier latency OBSERVATIONS 2x or better PostgreSQL Community Edition performance on write-only or mixed read-write workloads PERFORMANCE Boxcar log records—fully ordered by LSN Shuffle to appropriate segments—partially ordered Boxcar to storage nodes and issue writes WAL T Y P E O F W R IT E Read Replica/ Secondary Node
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IO Traffic in Aurora Replicas Physical: Ship redo (WAL) to Replica Write workload similar on both instances Independent, duplicated storage Heavy write load impairs read performance PAGE CACHE UPDATE Aurora Master 30% Read 70% Write Aurora Replica 100% New Reads Shared Multi-AZ Storage PostgreSQL Master 30% Read 70% Write PostgreSQL Replica 30% New Reads 70% Write SINGLE-THREADED WAL APPLY Data Volume Data Volume Physical: Ship redo (WAL) from Master to Replica Cached pages have redo applied Replica shares storage: no writes performed Replica can do more read work Advance read view as commits seen from master POSTGRESQL READ SCALING AMAZON AURORA READ SCALING
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Write IO Traffic in an Amazon Aurora storage node LOG RECORDS Primary Database Node INCOMING QUEUE STORAGE NODE AMAZON S3 BACKUP 1 2 3 4 5 6 7 8 UPDATE QUEUE ACK HOT LOG DATA BLOCKS POINT IN TIME SNAPSHOT GC SCRUB COALESCE SORT GROUP PEER-TO- PEER GOSSIPPeer Storage Nodes All steps are asynchronous Only steps 1 and 2 are in foreground latency path Input queue is far smaller than PostgreSQL Favors latency-sensitive operations Uses disk space to buffer against spikes in activity OBSERVATIONS IO FLOW ① Receive record and add to in-memory queue ② Persist record and acknowledge ③ Organize records and identify gaps in log ④ Gossip with peers to fill in holes ⑤ Coalesce log records into new data block versions ⑥ Periodically stage log and new block versions to Amazon S3 ⑦ Periodically garbage-collect old versions ⑧ Periodically validate CRC codes on blocks
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Aurora PostgreSQL Durability and Availability Architecture
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Aurora storage engine overview Data is replicated 6 times across 3 Availability Zones Continuous backup to Amazon S3 (built for 11 9s durability) Continuous monitoring of nodes and disks for repair 10 GB segments as unit of repair or hotspot rebalance Quorum system for read/write; latency tolerant Quorum membership changes do not stall writes Storage volume automatically grows up to 64 TB AZ 1 AZ 2 AZ 3 Amazon S3 Database Node Storage Node Storage Node Storage Node Storage Node Storage Node Storage Node Storage Monitoring
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Scale-out, distributed, log structured storage Master Replica Replica Replica Availability Zone 1 Shared Storage Volume—Transaction Aware Primary Database Node Read Replica/ Secondary Node Read Replica/ Secondary Node Read Replica/ Secondary Node Availability Zone 2 Availability Zone 3 AWS Region Storage Monitoring Database and Instance Monitoring
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What can fail? Segment failures (disks) Node failures (machines) AZ failures (network or datacenter) Optimizations 4 out of 6 write quorum 3 out of 6 read quorum Peer-to-peer replication for repairs Amazon Aurora Storage fault tolerance SQL Transaction AZ 1 AZ 2 AZ 3 Caching SQL Transaction AZ 1 AZ 2 AZ 3 Caching
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Aurora Replicas Availability Failing database nodes are automatically detected and replaced Failing database processes are automatically detected and recycled Replicas are automatically promoted to primary if needed (failover) Customer specifiable failover order AZ 1 AZ 3AZ 2 Primary Node Primary Node Primary Database Node Primary Node Primary Node Read Replica Primary Node Primary Node Read Replica Database and Instance Monitoring Performance Customer applications can scale out read traffic across read replicas Read balancing across read replicas
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Faster, more predictable failover with Amazon Aurora App RunningFailure Detection DNS Propagation Recovery Database Failure Amazon RDS for PostgreSQL is good: failover times of ~60 seconds Replica-Aware App Running Failure Detection DNS Propagation Recovery Database Failure Amazon Aurora is better: failover times < 30 seconds 1 5 - 2 0 s e c 3 - 1 0 s e c App Running
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Introduction to Aurora PostgreSQL • Performance Results from SRA OSS • Aurora Architecture • Pgpool-II Announcement • Performance Insights • Q&A
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Introducing Pgpool-II • Providing clustering features between application and PostgreSQL • Normally, Pgpool-II is used with PostgreSQL’s streaming replication • Open Source Software (BSD License) • Major version up per year • Latest version is 3.7 PostgreSQL Pgpool-IIClient Read/Write Query Write Primary Standby Standby Replication Read Read Pgpool-II details pgpool.net/mediawiki/index.php/Main_Page
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WE ARE ANNOUNCING… Pgpool-II 3.7 supports Amazon Aurora PostgreSQL and provides: • Automatic distribution of queries (UPDATE for master, SELECT for read replica) • Connection pooling and query cache • Configuration sample is included
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Introduction to Aurora PostgreSQL • Performance Results from SRA OSS • Aurora Architecture • Pgpool-II Announcement • Performance Insights • Q&A
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What is RDS Performance Insights? Customers ask for • Visibility into performance of RDS databases • Want to optimize cloud database workloads • Easy tool • Often only part-time DBA or no DBA • Single pane of glass
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. First Step: RDS Enhanced Monitoring Released 2016 OS Metrics Process/thread list Up to 1 second granularity
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Introducing: RDS Performance Insights Dashboard • DB load • Adjustable timeframe • Filterable by attribute (SQL, User, Host, Wait) • SQL causing load Phased RDS delivery • Aurora, MySQL/MariaDB, PostgreSQL, Oracle, SQL Server Guided discovery of performance problems • For both beginners and experts • Core metric is “Database Load”
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What is “Database Load?” All engines have a connections list showing • Active • Idle We sample every second • For each active session, collect • SQL, • State :CPU, I/O, Lock, Commit log wait, etc. • Host • User Expose as “Average Active Sessions” (AAS)
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RDS Performance Insights dashboard
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RDS Performance Insights
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Sampling Every Second Query run often Fast query, run rarely Slow query User 1 User 2 User 3 Time
  • 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Sampling is like film
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AAS load graph User 1 User 2 User 3 User 4 Active Sessions = 1 2 3 4
  • 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Active Session State CPU IO Wait idleidle idle idleQuery 1 Query 2 Query 3 Time
  • 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AAS over 1 minute averages
  • 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Access to RDS Performance Insights
  • 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Access to RDS Performance Insights High Load
  • 47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Summary: Amazon RDS Performance Insights  DB Load: Average Active Sessions  Identifies database bottlenecks  Easy  Powerful  Top SQL  Identifies source of bottleneck  Enables problem discovery  Adjustable timeframe  Hour, day, week, and longer  Questions:  rdspi@amazon.com
  • 48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Introduction to Aurora PostgreSQL • Performance Results from SRA OSS • Aurora Architecture • Pgpool-II Announcement • Performance Insights • Questions?
  • 49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THANK YOU! T a t s u o I s h i i , J a p a n P r e s i d e n t S R A O S S , I n c . M a r k P o r t e r G e n e r a l M a n a g e r A m a z o n R D S , A u r o r a , R D S f o r P o s t g r e S Q L (And pl ease fi l l out your sessi on revi ews)