SlideShare una empresa de Scribd logo
1 de 56
Using TPC-C to 
study Firebird 
Performance 
Paul Reeves 
IBPhoenix 
mail: preeves at ibphoenix.com
About the speaker 
I work for IBPhoenix providing technical support. 
I maintain the windows installer for Firebird and do the 
Windows builds.
Introduction 
The aim of this talk is to use the TPC-C 
benchmark to study : 
How does Firebird perform under load? 
Can we use the data collected from the tests to 
make evidence based decisions that will improve 
application performance?
What is TPC-C 
Models typical OLTP application 
Old fashioned “bricks'n'mortar” business – 
perhaps a wholesaler providing stock to 
shops? 
Five randomly generated workloads 
New Orders (45%) 
Payments (43%) 
Deliveries (4%) 
Stock-level checks (r/o) (4%) 
Order Status (r/o) (4%) 
Its main metric is the number of new orders 
per minute.
What's good about the benchmark ? 
Simple 
Synthetic 
(Fairly ) consistent, despite a high degree of 
randomisation. 
Stable platform to generate hundreds of 
hours of test data. (500+ so far.) 
Studying real data under load is always 
better than guess work.
What's bad about the benchmark ? 
No blobs 
No stored procedures 
Nothing special at all, really 
Very few business rules 
Very simple data model 
Very short rows 
Difficult to overload the hardware 
And, of course, it is not your data or your 
application.
The Test Harness 
Provides a consistent unchanging platform 
Server is 4-core x64 CPU with 8 GB RAM 
H/W Raid controller with 
4 * HDDs configured in RAID 10 
2 * SSDs configured in RAID 1 
Dual boots to 
Windows 2012 
openSUSE 13.1 
Firebird 2.5.3 is installed with SS,CS and SC open on different 
ports, using a single configuration file. 
Network connection is 1 Gbit. 
Client is another 4-core x64 CPU with 8 GB RAM 
The Benchmark app is written in Java executed from the client 
Test details and test results are stored in a separate Firebird 
database (on a remote server) for analysis.
Outline of the tests 
Firebird defaults except : 
3000 buffers hardcoded into each DB 
Sweep set to 0 
SS tied to two CPU (Windows Only) 
Each test run consists of 
Sweep 
gstat full before test 
15 minute test 
gstat full after test 
No special configuration of host O/S 
But updates applied. 
Test Series are fully automated
Test Coverage 
Windows, Linux 
HDD (RAID 10), SSD (RAID 1) 
SuperClassic, Classic, SuperServer 
Small, Large and Very Large Databases 
1 GB (effectively in memory) 
10 GB (must use the file system cache. 
40 GB (too large for fs cache so lots of swapping.) 
10..100 connections in steps of 10 connections 
That is a lot of test combinations (360)
Caveats - I 
Results are specific to : 
Firebird 2.5.3 
This test harness 
The results can only be a guide, not a rule. 
The main message to take away is the 
patterns the graphs produce, not the 
actual numbers.
Caveats – II 
Connections are NOT users 
Basically the test harness is using a 
connection pool
At last, let's look at some of the 
results
HDD vs SSD 
Overall, SSD is clearly a winner
Database Size and HDD vs SSD 
The story is not so simple...
Architecture
Windows vs Linux
Where is the problem with Windows performance?
Windows and Super Server still have a problem...
Influence of growing DB on performance
Impact of increased connections on TXN time
Impact of increased connections on 
Max TXN time
Impact of increased connections on NO PM
So, why the slow down as 
connections increase? 
New orders randomly add ~10 line items per order. 
Each line item requires an update of the quantity in the 
stock table. 
There are ~100,000 stock items. 
Even so, two txns could each order 10 items, and just 
one of which is identical to each txn. 
So we have 18 items locked for update and one 
deadlocked. 
A third txn comes along and tries to lock on of these 19 
items and so we now have 28 or 29 products locked. 
No order can commit until it has updated stock levels for 
all line items. 
And so it goes...
What can we learn from this? 
Fundamentally database architecture and 
application design have a profound effect on 
application performance. 
Ideally performance issues should be fixed 
at this level. 
For the TPC-C benchmark this means 
looking at other ways to manage the update 
of the stock levels. 
Of course this takes the most time and 
effort and doesn't solve the immediate 
problem.
Can we use the test harness to 
advise us on how to improve 
performance? 
The Hypothesis 
By running lots of tests with different 
configurations we can take averages of 
each test series and derive an optimal 
configuration.
We will look at three configuration 
parameters 
Page Size 
Buffers 
Hash Slots 
For each parameter we will run our test 
series, changing a single value each time.
Page Size 
8K appears to be ~17% better than 4K. 
And 16K not so interesting.
Page Size and Disc 
But again, things are not so simple...
Super Server and Page Size 
The previous slide indicated that 8K page size was optimum, 
but apparently this is not true for SS.
Buffers
Buffers – Classic Server 
Less is more
Buffers – Super Classic 
Can use more buffers 
~7 % improved performance over classic
Buffers – Super Server 
Chosen correctly can lead to 80% performance improvement over SC 
Note impact of 128K buffers – disables file system caching!
Buffers 
Incorrect settings have a massive (bad) impact 
Each architecture has different behaviour 
Must analyse by architecture 
CS – smaller is better 
SC (2.5 only) prefers smaller over larger 
SS – increase buffers to look for sweet spot – more is not 
better. 
(Tests carried out on 10 GB DB)
Hash Slots 
All database access generates lock table 
activity, even just simple selects. 
Locks are located via a hash table. 
They are linked in chains. 
The chains are searched sequentially. 
More hash slots allows for shorter chains. 
So in theory as connections increase we 
have more lock contention, and therefore 
more hash slots should improve 
performance.
The effect of different Hash Slots values
Towards an Optimal Config? 
To summarize: 
8K page size seems preferable for SC and CS 
4K page size seems better for SS but we'll test both 
8009 Hash Slots seems to improve performance for all 
architectures. 
Each arch. Has specific sweet spots for buffers 
SC – 3000. 
CS – 1000, perhaps 1500 ? 
SS – 32000. 
So, lets see how that works...
Compare Optimal to Defaults – Linux, SSD 1GB DB
Compare Optimal to Defaults – Linux, HDD 1GB DB
Compare Optimal to Defaults – Linux, SSD, 10GB
Compare Optimal to Defaults – Linux, HDD, 10GB
Compare Optimal to Defaults – Linux, SSD, 40GB
Compare Optimal to Defaults – Linux, HDD, 40GB
The big question 
Why don't SSDs seem to respond to our 
configuration techniques?
SSDs and SuperClassic - a recap
SSDs and Classic - a recap
SSDs and SuperServer - a recap
So why has SSD performance 
degraded? 
While reviewing this presentation I noticed 
that there was no analysis of the hash slots 
data. 
Perhaps the answer lies there? 
Let's take a look.
Perhaps the hash slots change is the 
problem with diminished SSD performance?
And our hypothesis? 
It clearly worked for HDDs 
SSDs did not respond or actually performed 
more poorly due to inadequate analysis (but 
we didn't know that until we had done the 
tests.) 
Ultimately this hypothesis failed but that is 
not a bad thing – we have learnt that: 
SSDs perform very differently to HDDs 
Determining optimal configurations requires much more 
refined data analysis. 
Optimal Settings do not transfer automatically to a 
different setup. 
Bad configuration choices have just as much an impact 
on performance as good ones do. ☺
Where next with this research? 
Obviously work needs to be done to understand 
better how to get the best performance out of 
SSDs 
Can the optimal configuration be refined further? 
What happens when we try different hash slots with our 
'optimal' page size and buffers? 
Ditto for a different page size. 
What happens if we play around a bit with the File 
System Cache size and the number of buffers? 
What happens if we remove the sources of lock 
contention in the application/data model? 
Lots of questions that still need answers.
Summary 
For Firebird 2.5.3 and this test harness... 
SSDs are better than HDDS, especially for VLDBs 
Linux and Windows perform similarly, except for SS under 
Windows. 
Usually SS is better than SC which is better than CS 
8K page size is usually better than 4K except for SS for 
HDDs 
Smaller buffers are better for CS 
SC doesn't care neither for large buffers nor small 
SS likes large buffers but not so big as to disable the file 
system cache. 
SSDs do not appear to respond to the same performance 
tweaks as HDDs.
Conclusion 
There is a fine balance to be had in all 
performance tweaking. 
Test everything. 
There is no universal optimised config.
Questions?
And finally, a big thankyou to all 
the sponsors who have helped 
make this conference possible...

Más contenido relacionado

La actualidad más candente

MySQL Server Settings Tuning
MySQL Server Settings TuningMySQL Server Settings Tuning
MySQL Server Settings Tuning
guest5ca94b
 
Storage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, WhiptailStorage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, Whiptail
Internet World
 

La actualidad más candente (20)

MySQL Server Settings Tuning
MySQL Server Settings TuningMySQL Server Settings Tuning
MySQL Server Settings Tuning
 
Storage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, WhiptailStorage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, Whiptail
 
Right-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual MachineRight-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual Machine
 
TPC-H in MongoDB
TPC-H in MongoDBTPC-H in MongoDB
TPC-H in MongoDB
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
 
PowerDNS with MySQL
PowerDNS with MySQLPowerDNS with MySQL
PowerDNS with MySQL
 
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
 
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability Methods
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New Features
 
Application Caching: The Hidden Microservice
Application Caching: The Hidden MicroserviceApplication Caching: The Hidden Microservice
Application Caching: The Hidden Microservice
 
Is It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB PerformanceIs It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB Performance
 
Geographically Distributed Multi-Master MySQL Clusters
Geographically Distributed Multi-Master MySQL ClustersGeographically Distributed Multi-Master MySQL Clusters
Geographically Distributed Multi-Master MySQL Clusters
 
X-DB Replication Server and MMR
X-DB Replication Server and MMRX-DB Replication Server and MMR
X-DB Replication Server and MMR
 
Cutting the pipe
Cutting the pipeCutting the pipe
Cutting the pipe
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)
 
PostreSQL HA and DR Setup & Use Cases
PostreSQL HA and DR Setup & Use CasesPostreSQL HA and DR Setup & Use Cases
PostreSQL HA and DR Setup & Use Cases
 
Continuous Deployment with Cassandra
Continuous Deployment with CassandraContinuous Deployment with Cassandra
Continuous Deployment with Cassandra
 

Destacado

How to translate patient information leaflets
How to translate patient information leafletsHow to translate patient information leaflets
How to translate patient information leaflets
Maja Źróbecka, MITI
 
Artba Senate Finance Committee May
Artba Senate Finance Committee MayArtba Senate Finance Committee May
Artba Senate Finance Committee May
artba
 
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
artba
 
09/25/13: Senate EPW Highway Trust Fund Hearing
09/25/13: Senate EPW Highway Trust Fund Hearing09/25/13: Senate EPW Highway Trust Fund Hearing
09/25/13: Senate EPW Highway Trust Fund Hearing
artba
 
Suggested Best Practices for Design-Build in Transportation Construction
Suggested Best Practices for Design-Build in Transportation ConstructionSuggested Best Practices for Design-Build in Transportation Construction
Suggested Best Practices for Design-Build in Transportation Construction
artba
 
02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee
artba
 

Destacado (19)

How to translate patient information leaflets
How to translate patient information leafletsHow to translate patient information leaflets
How to translate patient information leaflets
 
New York Times Ad opposing tighter ozone standards
New York Times Ad opposing tighter ozone standardsNew York Times Ad opposing tighter ozone standards
New York Times Ad opposing tighter ozone standards
 
Accessibility Matters - Supplemental Links
Accessibility Matters - Supplemental LinksAccessibility Matters - Supplemental Links
Accessibility Matters - Supplemental Links
 
Keeping Denial of Service and Financial Fraud out of Your Contact Center
Keeping Denial of Service and Financial Fraud out of Your Contact CenterKeeping Denial of Service and Financial Fraud out of Your Contact Center
Keeping Denial of Service and Financial Fraud out of Your Contact Center
 
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
Technical Delivery - Expanded Role for Technical Communicators, STC New Engla...
 
Artba Senate Finance Committee May
Artba Senate Finance Committee MayArtba Senate Finance Committee May
Artba Senate Finance Committee May
 
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
04/24/13: State of the Highway Trust Fund: Long-Term Solutions for Solvency
 
09/25/13: Senate EPW Highway Trust Fund Hearing
09/25/13: Senate EPW Highway Trust Fund Hearing09/25/13: Senate EPW Highway Trust Fund Hearing
09/25/13: Senate EPW Highway Trust Fund Hearing
 
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
Coalition Letter to Senate Majority Leader McConnell (R-Ky) on Chemical Safet...
 
Matapouri beach house
Matapouri beach houseMatapouri beach house
Matapouri beach house
 
Multi-Industry Letter to Congress on EPA Ozone Standards
Multi-Industry Letter to Congress on EPA Ozone StandardsMulti-Industry Letter to Congress on EPA Ozone Standards
Multi-Industry Letter to Congress on EPA Ozone Standards
 
Suggested Best Practices for Design-Build in Transportation Construction
Suggested Best Practices for Design-Build in Transportation ConstructionSuggested Best Practices for Design-Build in Transportation Construction
Suggested Best Practices for Design-Build in Transportation Construction
 
Comments Objecting to ESA protections for the Long-Eared Bat
Comments Objecting to ESA protections for the Long-Eared BatComments Objecting to ESA protections for the Long-Eared Bat
Comments Objecting to ESA protections for the Long-Eared Bat
 
Accessibility Matters: Making Your Product Available to Everyone
Accessibility Matters: Making Your Product Available to EveryoneAccessibility Matters: Making Your Product Available to Everyone
Accessibility Matters: Making Your Product Available to Everyone
 
FHWA MOU with the State of Alaska Regarding Delegation of CEs.
FHWA MOU with the State of Alaska Regarding Delegation of CEs.FHWA MOU with the State of Alaska Regarding Delegation of CEs.
FHWA MOU with the State of Alaska Regarding Delegation of CEs.
 
Coalition Letter to House Energy and Commerce Committee Leaders on Chemical S...
Coalition Letter to House Energy and Commerce Committee Leaders on Chemical S...Coalition Letter to House Energy and Commerce Committee Leaders on Chemical S...
Coalition Letter to House Energy and Commerce Committee Leaders on Chemical S...
 
The Experience Comes First (STC New England - InterChange2016)
The Experience Comes First (STC New England - InterChange2016)The Experience Comes First (STC New England - InterChange2016)
The Experience Comes First (STC New England - InterChange2016)
 
02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee02/12/14: Testimony to Senate Environment & Public Works Committee
02/12/14: Testimony to Senate Environment & Public Works Committee
 
How does Linked Open Data change the publishing landscape?
How does Linked Open Data change the publishing landscape?How does Linked Open Data change the publishing landscape?
How does Linked Open Data change the publishing landscape?
 

Similar a Using ТРСС to study Firebird performance

QCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AIQCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AI
Lex Yu
 

Similar a Using ТРСС to study Firebird performance (20)

Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
Ceph Day Shanghai - SSD/NVM Technology Boosting Ceph Performance
 
SQL Server It Just Runs Faster
SQL Server It Just Runs FasterSQL Server It Just Runs Faster
SQL Server It Just Runs Faster
 
Benchmarking Performance: Benefits of PCIe NVMe SSDs for Client Workloads
Benchmarking Performance: Benefits of PCIe NVMe SSDs for Client WorkloadsBenchmarking Performance: Benefits of PCIe NVMe SSDs for Client Workloads
Benchmarking Performance: Benefits of PCIe NVMe SSDs for Client Workloads
 
IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...
IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...
IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...
 
Accelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cacheAccelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cache
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
 
Database Performance of Intel Cache Acceleration Software
Database Performance of Intel Cache Acceleration SoftwareDatabase Performance of Intel Cache Acceleration Software
Database Performance of Intel Cache Acceleration Software
 
Smart SSD Controller with Flexibility
Smart SSD Controller with FlexibilitySmart SSD Controller with Flexibility
Smart SSD Controller with Flexibility
 
Performance Tipping Points - Hitting Hardware Bottlenecks
Performance Tipping Points - Hitting Hardware BottlenecksPerformance Tipping Points - Hitting Hardware Bottlenecks
Performance Tipping Points - Hitting Hardware Bottlenecks
 
WTF?
WTF?WTF?
WTF?
 
QCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AIQCon2016--Drive Best Spark Performance on AI
QCon2016--Drive Best Spark Performance on AI
 
AWS June Webinar Series - Getting Started: Amazon Redshift
AWS June Webinar Series - Getting Started: Amazon RedshiftAWS June Webinar Series - Getting Started: Amazon Redshift
AWS June Webinar Series - Getting Started: Amazon Redshift
 
Ceph
CephCeph
Ceph
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Deep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech Talks
Deep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech TalksDeep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech Talks
Deep Dive on Amazon EC2 Instances - January 2017 AWS Online Tech Talks
 
Optimizing columnar stores
Optimizing columnar storesOptimizing columnar stores
Optimizing columnar stores
 
Optimizing columnar stores
Optimizing columnar storesOptimizing columnar stores
Optimizing columnar stores
 
Hands-on Lab: How to Unleash Your Storage Performance by Using NVM Express™ B...
Hands-on Lab: How to Unleash Your Storage Performance by Using NVM Express™ B...Hands-on Lab: How to Unleash Your Storage Performance by Using NVM Express™ B...
Hands-on Lab: How to Unleash Your Storage Performance by Using NVM Express™ B...
 
The Apache Spark config behind the indsutry's first 100TB Spark SQL benchmark
The Apache Spark config behind the indsutry's first 100TB Spark SQL benchmarkThe Apache Spark config behind the indsutry's first 100TB Spark SQL benchmark
The Apache Spark config behind the indsutry's first 100TB Spark SQL benchmark
 
IO Dubi Lebel
IO Dubi LebelIO Dubi Lebel
IO Dubi Lebel
 

Más de Mind The Firebird

Tips for using Firebird system tables
Tips for using Firebird system tablesTips for using Firebird system tables
Tips for using Firebird system tables
Mind The Firebird
 
A year in the life of Firebird .Net provider
A year in the life of Firebird .Net providerA year in the life of Firebird .Net provider
A year in the life of Firebird .Net provider
Mind The Firebird
 
How Firebird transactions work
How Firebird transactions workHow Firebird transactions work
How Firebird transactions work
Mind The Firebird
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
Mind The Firebird
 

Más de Mind The Firebird (20)

Tips for using Firebird system tables
Tips for using Firebird system tablesTips for using Firebird system tables
Tips for using Firebird system tables
 
Using Azure cloud and Firebird to develop applications easily
Using Azure cloud and Firebird to develop applications easilyUsing Azure cloud and Firebird to develop applications easily
Using Azure cloud and Firebird to develop applications easily
 
A year in the life of Firebird .Net provider
A year in the life of Firebird .Net providerA year in the life of Firebird .Net provider
A year in the life of Firebird .Net provider
 
How Firebird transactions work
How Firebird transactions workHow Firebird transactions work
How Firebird transactions work
 
SuperServer in Firebird 3
SuperServer in Firebird 3SuperServer in Firebird 3
SuperServer in Firebird 3
 
Copycat presentation
Copycat presentationCopycat presentation
Copycat presentation
 
Overview of RedDatabase 2.5
Overview of RedDatabase 2.5Overview of RedDatabase 2.5
Overview of RedDatabase 2.5
 
Creating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQLCreating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQL
 
Firebird Performance counters in details
Firebird Performance counters in detailsFirebird Performance counters in details
Firebird Performance counters in details
 
Understanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLUnderstanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQL
 
New SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad KhorsunNew SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad Khorsun
 
Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016
 
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
 
Working with Large Firebird databases
Working with Large Firebird databasesWorking with Large Firebird databases
Working with Large Firebird databases
 
Stored procedures in Firebird
Stored procedures in FirebirdStored procedures in Firebird
Stored procedures in Firebird
 
Firebird on Linux
Firebird on LinuxFirebird on Linux
Firebird on Linux
 
Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...
 
Firebird meets NoSQL
Firebird meets NoSQLFirebird meets NoSQL
Firebird meets NoSQL
 
Continuous Database Monitoring with the Trace API
Continuous Database Monitoring with the Trace APIContinuous Database Monitoring with the Trace API
Continuous Database Monitoring with the Trace API
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Último (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 

Using ТРСС to study Firebird performance

  • 1. Using TPC-C to study Firebird Performance Paul Reeves IBPhoenix mail: preeves at ibphoenix.com
  • 2.
  • 3. About the speaker I work for IBPhoenix providing technical support. I maintain the windows installer for Firebird and do the Windows builds.
  • 4. Introduction The aim of this talk is to use the TPC-C benchmark to study : How does Firebird perform under load? Can we use the data collected from the tests to make evidence based decisions that will improve application performance?
  • 5. What is TPC-C Models typical OLTP application Old fashioned “bricks'n'mortar” business – perhaps a wholesaler providing stock to shops? Five randomly generated workloads New Orders (45%) Payments (43%) Deliveries (4%) Stock-level checks (r/o) (4%) Order Status (r/o) (4%) Its main metric is the number of new orders per minute.
  • 6. What's good about the benchmark ? Simple Synthetic (Fairly ) consistent, despite a high degree of randomisation. Stable platform to generate hundreds of hours of test data. (500+ so far.) Studying real data under load is always better than guess work.
  • 7. What's bad about the benchmark ? No blobs No stored procedures Nothing special at all, really Very few business rules Very simple data model Very short rows Difficult to overload the hardware And, of course, it is not your data or your application.
  • 8. The Test Harness Provides a consistent unchanging platform Server is 4-core x64 CPU with 8 GB RAM H/W Raid controller with 4 * HDDs configured in RAID 10 2 * SSDs configured in RAID 1 Dual boots to Windows 2012 openSUSE 13.1 Firebird 2.5.3 is installed with SS,CS and SC open on different ports, using a single configuration file. Network connection is 1 Gbit. Client is another 4-core x64 CPU with 8 GB RAM The Benchmark app is written in Java executed from the client Test details and test results are stored in a separate Firebird database (on a remote server) for analysis.
  • 9. Outline of the tests Firebird defaults except : 3000 buffers hardcoded into each DB Sweep set to 0 SS tied to two CPU (Windows Only) Each test run consists of Sweep gstat full before test 15 minute test gstat full after test No special configuration of host O/S But updates applied. Test Series are fully automated
  • 10. Test Coverage Windows, Linux HDD (RAID 10), SSD (RAID 1) SuperClassic, Classic, SuperServer Small, Large and Very Large Databases 1 GB (effectively in memory) 10 GB (must use the file system cache. 40 GB (too large for fs cache so lots of swapping.) 10..100 connections in steps of 10 connections That is a lot of test combinations (360)
  • 11. Caveats - I Results are specific to : Firebird 2.5.3 This test harness The results can only be a guide, not a rule. The main message to take away is the patterns the graphs produce, not the actual numbers.
  • 12. Caveats – II Connections are NOT users Basically the test harness is using a connection pool
  • 13. At last, let's look at some of the results
  • 14. HDD vs SSD Overall, SSD is clearly a winner
  • 15. Database Size and HDD vs SSD The story is not so simple...
  • 18. Where is the problem with Windows performance?
  • 19. Windows and Super Server still have a problem...
  • 20. Influence of growing DB on performance
  • 21. Impact of increased connections on TXN time
  • 22. Impact of increased connections on Max TXN time
  • 23. Impact of increased connections on NO PM
  • 24. So, why the slow down as connections increase? New orders randomly add ~10 line items per order. Each line item requires an update of the quantity in the stock table. There are ~100,000 stock items. Even so, two txns could each order 10 items, and just one of which is identical to each txn. So we have 18 items locked for update and one deadlocked. A third txn comes along and tries to lock on of these 19 items and so we now have 28 or 29 products locked. No order can commit until it has updated stock levels for all line items. And so it goes...
  • 25. What can we learn from this? Fundamentally database architecture and application design have a profound effect on application performance. Ideally performance issues should be fixed at this level. For the TPC-C benchmark this means looking at other ways to manage the update of the stock levels. Of course this takes the most time and effort and doesn't solve the immediate problem.
  • 26. Can we use the test harness to advise us on how to improve performance? The Hypothesis By running lots of tests with different configurations we can take averages of each test series and derive an optimal configuration.
  • 27. We will look at three configuration parameters Page Size Buffers Hash Slots For each parameter we will run our test series, changing a single value each time.
  • 28. Page Size 8K appears to be ~17% better than 4K. And 16K not so interesting.
  • 29. Page Size and Disc But again, things are not so simple...
  • 30. Super Server and Page Size The previous slide indicated that 8K page size was optimum, but apparently this is not true for SS.
  • 32. Buffers – Classic Server Less is more
  • 33. Buffers – Super Classic Can use more buffers ~7 % improved performance over classic
  • 34. Buffers – Super Server Chosen correctly can lead to 80% performance improvement over SC Note impact of 128K buffers – disables file system caching!
  • 35. Buffers Incorrect settings have a massive (bad) impact Each architecture has different behaviour Must analyse by architecture CS – smaller is better SC (2.5 only) prefers smaller over larger SS – increase buffers to look for sweet spot – more is not better. (Tests carried out on 10 GB DB)
  • 36. Hash Slots All database access generates lock table activity, even just simple selects. Locks are located via a hash table. They are linked in chains. The chains are searched sequentially. More hash slots allows for shorter chains. So in theory as connections increase we have more lock contention, and therefore more hash slots should improve performance.
  • 37. The effect of different Hash Slots values
  • 38. Towards an Optimal Config? To summarize: 8K page size seems preferable for SC and CS 4K page size seems better for SS but we'll test both 8009 Hash Slots seems to improve performance for all architectures. Each arch. Has specific sweet spots for buffers SC – 3000. CS – 1000, perhaps 1500 ? SS – 32000. So, lets see how that works...
  • 39. Compare Optimal to Defaults – Linux, SSD 1GB DB
  • 40. Compare Optimal to Defaults – Linux, HDD 1GB DB
  • 41. Compare Optimal to Defaults – Linux, SSD, 10GB
  • 42. Compare Optimal to Defaults – Linux, HDD, 10GB
  • 43. Compare Optimal to Defaults – Linux, SSD, 40GB
  • 44. Compare Optimal to Defaults – Linux, HDD, 40GB
  • 45. The big question Why don't SSDs seem to respond to our configuration techniques?
  • 47. SSDs and Classic - a recap
  • 48. SSDs and SuperServer - a recap
  • 49. So why has SSD performance degraded? While reviewing this presentation I noticed that there was no analysis of the hash slots data. Perhaps the answer lies there? Let's take a look.
  • 50. Perhaps the hash slots change is the problem with diminished SSD performance?
  • 51. And our hypothesis? It clearly worked for HDDs SSDs did not respond or actually performed more poorly due to inadequate analysis (but we didn't know that until we had done the tests.) Ultimately this hypothesis failed but that is not a bad thing – we have learnt that: SSDs perform very differently to HDDs Determining optimal configurations requires much more refined data analysis. Optimal Settings do not transfer automatically to a different setup. Bad configuration choices have just as much an impact on performance as good ones do. ☺
  • 52. Where next with this research? Obviously work needs to be done to understand better how to get the best performance out of SSDs Can the optimal configuration be refined further? What happens when we try different hash slots with our 'optimal' page size and buffers? Ditto for a different page size. What happens if we play around a bit with the File System Cache size and the number of buffers? What happens if we remove the sources of lock contention in the application/data model? Lots of questions that still need answers.
  • 53. Summary For Firebird 2.5.3 and this test harness... SSDs are better than HDDS, especially for VLDBs Linux and Windows perform similarly, except for SS under Windows. Usually SS is better than SC which is better than CS 8K page size is usually better than 4K except for SS for HDDs Smaller buffers are better for CS SC doesn't care neither for large buffers nor small SS likes large buffers but not so big as to disable the file system cache. SSDs do not appear to respond to the same performance tweaks as HDDs.
  • 54. Conclusion There is a fine balance to be had in all performance tweaking. Test everything. There is no universal optimised config.
  • 56. And finally, a big thankyou to all the sponsors who have helped make this conference possible...

Notas del editor

  1. HDD performance actually declines as DB size increases, while SSD performance improves!
  2. SS and SC are statistically too close.
  3. Drill down produces same results 5% would be statistically insignificant. 10% would not merit retraining costs if no in-house linux skills. But 20% …
  4. Important in terms of provisioning. Doubling in size indicates a loss of 20% performance.
  5. Statistically significant, but more research needed.
  6. Need to re-run the buffers tests to generate more data points.
  7. 8009 is unequivocally recommended. Note again that more does not mean better.