oltp performance benchmark review - pgcon · oltp performance benchmark review jignesh shah product...

35
© 2010 VMware Inc. All rights reserved OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, Inc

Upload: lecong

Post on 25-Nov-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

© 2010 VMware Inc. All rights reserved

OLTP Performance Benchmark Review

Jignesh Shah

Product Manager, vFabric Postgres

VMware, Inc

Page 2: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

2 2012 Copyright VMware Inc

About Me

§  Currently Product Manager of vFabric Postgres §  Performance Engineer , vFabric Data Director §  Previously with Sun Microsystems (2000-2010) §  Team Member that delivered the first published mainstream

benchmark with PostgreSQL §  Blog at : http://jkshah.blogspot.com

Page 3: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

3 2012 Copyright VMware Inc

Agenda

§  Introduction §  pgbench §  Sysbench §  Dbt2 §  BenchmarkSQL §  DVDStore §  A New benchmark

Page 4: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

4 2012 Copyright VMware Inc

Introduction § Why do we need benchmarks?

• Reference data points •  Stress Test for “Too Big to Fail” scenarios

§  Uses of Benchmark •  Improve Product Quality

•  Understand code path usage •  Performance Characteristics

•  Baseline metrics (Reference points) •  Release to release •  Against other technologies to do same business operation

§  Abuses of Benchmark •  Benchmarketing

•  Fixated only on ones that are favorable

Page 5: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

5 2012 Copyright VMware Inc

pgbench PostgreSQL

Page 6: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

6 2012 Copyright VMware Inc

Pgbench

§  Based on TPC-B workload (circa 1990) §  Not an OLTP but stress benchmark for database §  Ratio is Branches: 10 Tellers: 100,000 Accounts §  Default TPC-B sort-of

•  Account transactions also impact teller and branch balances •  Branch table becomes the biggest bottleneck

Branches

Tellers Accounts

History

Page 7: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

7 2012 Copyright VMware Inc

Pgbench §  Hints

•  PGSSLMODE disable (Unless you want to factor SSL communication overhead. Depending on your distribution )

•  -M prepared (unless you want to measure overhead of parsing)

§  Various modes of benchmark §  Default TPC-B sort-of

•  Account transactions also impact teller and branch balances

•  Branch table becomes the biggest bottleneck

§  -N Simple Update (with select, insert) •  Account Update, Select balance. History insert •  Account table update becomes the biggest bottleneck

§  -S read only test •  AccessShareLock on Accounts table and primary index becomes the

bottleneck

•  Fixed in 9.2 (Thanks Robert Haas)

Page 8: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

8 2012 Copyright VMware Inc

PGBench Select Test

0

10000

20000

30000

40000

50000

60000

70000

80000

0 20 40 60 80 100 120

Tran

sact

ions

Per

Sec

ond

Number of Clients

PGBench - Select Test

PG9.1 PGBench Select

9.2 PGBench Select

Page 9: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

9 2012 Copyright VMware Inc

PGBench TPC-B Like Test

0

1000

2000

3000

4000

5000

6000

7000

8000

0 20 40 60 80 100 120

Tran

sact

ions

Per

Sec

ond

Number of Clients

PGBench (TPC-B Like)

PG9.1 TPC-B Like

9.2 TPC-B Like

Page 10: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

10 2012 Copyright VMware Inc

Sysbench MySQL

Page 11: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

11 2012 Copyright VMware Inc

sysbench

§ Originally developed to test systems §  Has an OLTP component which was based on MySQL §  Creates a table sbtest with a pimary key. §  Various Modes of OLTP operation §  Simple Read Only (web site primary key lookup) §  Complex Read Only §  Complex Read Write test

Page 12: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

12 2012 Copyright VMware Inc

Sysbench – OLTP Simple Read

0

10000

20000

30000

40000

50000

60000

70000

80000

90000

100000

0 20 40 60 80 100 120

Tran

sact

ions

Per

Sec

ond

Number of Clients

Sysbench Simple Read

OLTP Simple Read

9.2 OLTP Simple Read

Page 13: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

13 2012 Copyright VMware Inc

Sysbench – OLTP Complex Read

0

1000

2000

3000

4000

5000

6000

0 20 40 60 80 100 120

Tran

sact

ions

Per

Sec

ond

Number of Clients

Sysbench Complex Read

OLTP Complex Read

9.2 OLTP Complex Read

Page 14: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

14 2012 Copyright VMware Inc

Sysbench – OLTP Complex Read/Write

0

500

1000

1500

2000

2500

3000

0 20 40 60 80 100 120

Tran

sact

ions

Per

Sec

ond

Number of Clients

Sysbench OLTP Complex R/W

OLTP Complex Write

9.2 OLTP Complex Write

Page 15: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

15 2012 Copyright VMware Inc

Sysbench – Complex R/W Note

§  In 9.0 it was impossible to run sysbench complex r/w without hitting error - ERROR:  duplicate key value violates unique constraint "sbtest_pkey"

§  In 9.1 SSI was introduced and occurrence went down drastically §  In 9.2 havent encountered the occurence

Page 16: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

16 2012 Copyright VMware Inc

dbt2

Page 17: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

17 2012 Copyright VMware Inc

Dbt2 -

§  Fair Use implementation of TPC-C §  Implemented using C stored procedures using

driver->client->database server architecture §  Nine Tables §  Five Transactions –

• New-Order (NOTPM) 45% •  Payment 43%

• Delivery 4% • Order Status 4%

•  Stock Level 4%

Warehouses Stock

Item District

Customer

History

Orders

Order Lines

New Orders

Page 18: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

18 2012 Copyright VMware Inc

Dbt2 -

§ Why is it not TPC-C compliant? • Not audited by TPC • No Terminal emulator

• Official kit requires commercial Transaction Manager • Doesn’t’ cover ACID tests

§  Two versions Available •  Libpq • ODBC

§ One potential problem is 3 network roundtrips per transaction which causes “Idle in Transaction” at high load •  BEGIN, SELECT StoredProcedure() , END pattern of transactions

Page 19: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

19 2012 Copyright VMware Inc

Dbt2 – Postgres 9.1

Cached Runs (data in bufferpool) Short runs (limited checkpoint and vacuum impacts)

NOTPM = 45% of all DB Trans DB Trans rate about 3000 TPS

Page 20: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

20 2012 Copyright VMware Inc

BenchmarkSQL

Page 21: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

21 2012 Copyright VMware Inc

BenchmarkSQL-

§  Another implementation using TPC-C schema §  Implemented using JDBC §  Nine Tables §  Five Transactions –

• New-Order (NOTPM) 45% •  Payment 43%

• Delivery 4% • Order Status 4%

•  Stock Level 4%

§  Surprisingly can do better than dbt2 implementation but still has “idle in transactions” which means bottlenecked at network/client level

Warehouses Stock

Item District

Customer

History

Orders

Order Lines

New Orders

Page 22: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

22 2012 Copyright VMware Inc

DVDStore

Page 23: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

23 2012 Copyright VMware Inc

DVDStore

§  Implementation of Online DVD Store §  Postgres support contributed by VMware §  Implemented using various stacks

•  JSP/Java/JDBC (supports Postgres) •  Linux/Apache/PHP/MySQL (supports Postgres)

•  ASP.NET (not yet implemented for Postgres) •  Stored Procedures (supports Postgres via Npgsql)

§  Eight Tables § Main Transactions –

• New-Customers 0-10% (configurable)

• Customer Login • DVD Browse (By category, by actor, by title)

•  Purchase Order (Metric – Orders Per Minute) •  Stock ReOrder (via Triggers)

Customers Cust_hist

Inventory Product

Categories

Reorder

Orders

Order Lines

Page 24: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

24 2012 Copyright VMware Inc

DVDStore

§  JSP/Java JDBC Implementation •  Tomcat may need tuning

§  PHP-Postgres Implementation •  Suffers from one connection per SQL command

• Needs pg_bouncer (on same server as web server) and configure local connections to pg_bouncer which does connection caching to actual Postgres server

§  Stored Procedure Implementation •  Fastest Implementation (> 100,000 orders per minute) •  Idle in transactions can still occur.

§  Metric is Orders Per Minute •  DB Transactions = (6-7 * OPM/60) ~ 10K – 11K TPS

Page 25: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

25 2012 Copyright VMware Inc

TPC-E/V

Page 26: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

26 2012 Copyright VMware Inc

Genesis of TPC-V

§  Users are demanding benchmarks to measure performance of databases in a virtual environment •  Existing virtualization benchmarks model consolidation:

•  Many VMs •  Small VMs •  Non-database workloads

§  TPC is developing a benchmark to satisfy that demand: TPC-V •  An OLTP workload typical of TPC benchmarks

•  Fewer, larger VMs • Cloud characteristics:

•  Variability: mix of small and large VMs •  Elasticity: load driven to each VM varies by 10X

Page 27: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

27 2012 Copyright VMware Inc

Benchmark requirements

§  Satisfies the industry need for a benchmark that: • Has a database-centric workload •  Stresses virtualization layer • Moderate # of VMs, exercising enterprise applications • Healthy storage and networking I/O content; emphasizes I/O in a virtualized

environment • NOT many app environments in an app consolidation scenario

§  Timely development cycle (1-2 years) •  Based on the TPC-E benchmark and borrows a lot from it

Page 28: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

28 2012 Copyright VMware Inc

What is TPC-E

§  TPC-E is theTPC’s latest OLTP benchmark • More complex than TPC-C •  Less I/O than TPC-C

•  A lot of the code is TPC-supplied

§ Models a brokerage firm

Customers Brokers Market

READ-WRITE•Market-Feed•Trade-Order •Trade-Result•Trade-Update

•Security-Detail•Trade-Lookup•Trade-Status

READ-ONLY•Broker-Volume•Customer-Position•Market-Watch

Invoke the following transactions …

… against the following data

Customer Data Brokerage Data Market Data

Customers Brokers Market

READ-WRITE•Market-Feed•Trade-Order •Trade-Result•Trade-Update

•Security-Detail•Trade-Lookup•Trade-Status

READ-ONLY•Broker-Volume•Customer-Position•Market-Watch

READ-WRITE•Market-Feed•Trade-Order •Trade-Result•Trade-Update

•Security-Detail•Trade-Lookup•Trade-Status

READ-ONLY•Broker-Volume•Customer-Position•Market-Watch

Invoke the following transactions …

… against the following data

Customer Data Brokerage Data Market Data

Page 29: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

29 2012 Copyright VMware Inc

Abstraction of the Functional Components in an OLTP Environment

UserInterfaces

NetworkNetwork

DatabaseServices

Modeled Business

ApplicationAnd

Business LogicServices

PresentationServices

MarketExchange Legend

Customer

Sponsor Provided

Stock Market

UserInterfaces

NetworkNetwork

DatabaseServices

Modeled Business

ApplicationAnd

Business LogicServices

PresentationServices

MarketExchange

UserInterfaces

NetworkNetwork

DatabaseServices

Modeled Business

ApplicationAnd

Business LogicServices

PresentationServices

MarketExchange Legend

Customer

Sponsor Provided

Stock Market

LegendLegend

Customer

Sponsor Provided

Stock Market

Customer

Sponsor Provided

Stock Market

Page 30: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

30 2012 Copyright VMware Inc

Functional Components of TPC-E Test Configuration

SponsorProvided

Frame Implementation

Database Logic

EGenTxnHarness Connector

TPC-E Logic and Frame Calls

EGenDriver Connector

EGenDriverCE

CE…

…CE

EGenDriverMEE

MEE…

…MEE

EGenDriverDM

DM…

…DM

Driving and Reporting

EGenDriver

EGenTxnHarness

CommercialProduct

SponsorProvided

SponsorProvided

SponsorProvided

TPC DefinedInterfaces

TPC DefinedInterface

DBMS

Network

Commercial Product

TPC Provided

Sponsor Provided

TPC DefinedInterface

Legend

Database Interface

SponsorProvided

Frame Implementation

Database Logic

EGenTxnHarness Connector

TPC-E Logic and Frame Calls

EGenDriver Connector

EGenDriverCE

CE…

…CE

EGenDriverMEE

MEE…

…MEE

EGenDriverDM

DM…

…DM

Driving and Reporting

EGenDriver

EGenTxnHarness

CommercialProduct

SponsorProvided

SponsorProvided

SponsorProvided

TPC DefinedInterfaces

TPC DefinedInterface

DBMS

Network

Commercial Product

TPC Provided

Sponsor Provided

TPC DefinedInterface

Legend

Commercial Product

TPC Provided

Sponsor Provided

TPC DefinedInterface

Legend

Database Interface

Page 31: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

31 2012 Copyright VMware Inc

How does this all matter to the PostgreSQL community?

§  TPC is developing a benchmarking kit for TPC-V •  First time TPC has gone beyond publishing a functional specification •  Full, end-to-end functionality •  Publicly available kit •  Produces the variability and load elasticity properties of the benchmark

•  Users need not worry about complexities of simulating cloud characteristics • Runs against an open source database •  A “reference” kit; companies are allowed to develop their own kit

§  Anyone can install the kit and pound on the server with a cloud database workload • Removes the high cost of entry typical to TPC benchmarks

§  The reference kit will run on PostgreSQL • ODBC interface allows running the workload against other databases

§  Tentative plans to also release a TPC-E kit • We started out with a kit to run TPC-E; now adding the TPC-V properties

Page 32: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

32 2012 Copyright VMware Inc

Our dependence on PostgreSQL

§  This reference kit will be a very successful new benchmark •  But only if its performance on the open source database is at least decent

compared to commercial databases §  PostgreSQL can benefit a lot from being the reference database for a

major new benchmark •  But only its performance is decent!

§  Running the TPC-E prototype on PGSQL 8.4 on RHEL 6.1, we are at ~20% of published TPC-E results •  Very early results • Current testbed is memory challenged • Good news: Query plans for the 10 queries implemented look good •  Long, mostly-read queries => issue is the basic execution path, not redo log,

latch contention, etc.

Page 33: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

33 2012 Copyright VMware Inc

Benchmark Development Status

§  TPC-V Development Subcommittee •  9 member companies •  3-4 engineers working actively on the reference kit

• On version 0.12 of the draft spec •  Worked through a lot of thorny issues

•  Betting the farm on the reference kit •  But if we produce a good kit, TPC-V will be an immediate success

§ We expect to make a kit available to member companies in Q3 or Q4

Bottom line: Cooperating to make the TPC-E/TPC-V reference kits run well on PostgreSQL will greatly benefit all of us

Page 34: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

34 2012 Copyright VMware Inc

Acknowledgements!

§  VMware Performance Team • Dong, Reza

§  VMware vFabric Postgres Team •  David Fetter, Dan, Alex, Nikhil, Scott, Yolanda

Page 35: OLTP Performance Benchmark Review - PGCon · OLTP Performance Benchmark Review Jignesh Shah Product Manager, vFabric Postgres VMware, ... • Tomcat may need tuning ! PHP-Postgres

35 2012 Copyright VMware Inc

Thank You