SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Measuring Firebird Disc I/O



        Paul Reeves



         IBPhoenix
Introduction

Disc I/O is one of the main bottlenecks in
Firebird. A good disc array can give a
massive increase in available IOPS. The
question is how do we measure our disc
I/O requirements?
Two Basic Ways To Measure IO

From within Firebird itself
From the host O/S
Measuring I/O from Firebird

 Firebird knows what it has done –
MON$IO_STATS allows us to catch this
info.
 Portable across platforms and architecures
 Works wih all versions since Fb 2.1
 Sort of a work in progress -enhanced in 2.5
MON$IO_STATS

Firebird tracks four IO counters

Page Reads - physical reads from disc
Page Writes – physical writes to disc
Page Fetches – pages read from memory
Page Marks – pages marked in memory for
writing to disc.
About Fetches

Mostly we can ignore Fetches but be sure to
make sure that the cache is big enough
otherwise excessive reads will occur.

Be sure to tune DB Cache before drawing
any conclusions about Firebird disc I/O.
Understanding How the MON$
        tables work
 All the Firebird monitoring tables run within
snapshot table stability transactions.
 You need to start a new transaction to see
the latest data in the monitoring tables.
 Historic data is not stored.
 Once a transaction is finished or an attach-
ment is disconnected the details disappear
from the monitoring tables.
 Cumulative database level stats requires
persistent connections. This means that
even database level stats are lost if all con-
nections to the database are closed.
Making Stats persist - DBTriggers

 DB Triggers available at Connection and
 Transaction Level.
 Stats are stored at Attachment and Trans-
 action Level (amongst others.)
 Solution – catch stats at end of Connection
 or Transaction.
Capturing Txn Stats

 Initial analysis indicated that txn level stats
may not be complete – more study required.
 Worse – Txn commit triggers and read only
transactions don't mix.
Capturing Connection Level Stats

 Stats seem to be complete(ish).
 No problems with r/o txns.
A table to store the data
CREATE TABLE PERSISTENT_IO_STATS (
PERSISTENT_IO_STATS_ID INTEGER NOT NULL,
LOG_TIME TIMESTAMP
DEFAULT CURRENT_TIMESTAMP NOT NULL
MON$STAT_ID INTEGER,
MON$STAT_GROUP SMALLINT,
MON$PAGE_READS BIGINT,
MON$PAGE_WRITES BIGINT,
MON$PAGE_FETCHES BIGINT,
MON$PAGE_MARKS BIGINT,
MON$REMOTE_ADDRESS VARCHAR(253),
MON$REMOTE_PROCESS VARCHAR(253),
MON$USER CHAR(31),
MON$ATTACHMENT_ID INTEGER,
DURATION BIGINT,
CONSTRAINT PK_PERSISTENT_IO_STATS PRIMARY
KEY (PERSISTENT_IO_STATS_ID)
);
And a trigger to capture it with...
Add a couple of Stored Procs...

And we can start to analyse our disc I/O by
Application, User, IP address.
Add a couple of Stored Procs...
And we can start to analyse our disc I/O by
Application, User, IP address.
Problems with MON$IO_STATS

 Attachment level stats are almost complete
– except that SS doesn't include back-
ground threads.
 Accurate stats can only be acquired by
running Classic.
 Long running attachments will produce rub-
bish stats if tracking IOPS is the goal.
 But well written applications do not leave
connections open – do they?.
Using the host O/S for monitoring

  All? modern O/S have monitoring and dia-
 gnostic tools. We'll take a look at the one
 that comes with Windows.
Setting up perfmon

Perfmon has one of the worst gui designs I
have ever seen.
Fortunately we don't have to use it.
We use logman instead.
Logman is the script interface to the perf-
mon counters.
Register a counter set for logman
Typical command-line:
 logman.exe create counter configname -cf
 d:pathtodconfig.cfg -f csv --v -o
 d:pathtodoutputfile -y -si 1

These options mean:
 Param    Description

  -cf     Name of config file

 -f csv   Use csv file format

  --v     Attach file versioning information to the end of the log name

 -o       Output path and file name

 -y       Answer yes to all questions without prompting

 -si 1    Sample interval in seconds.
What to log at disc level?
Counter                                             Description
CacheData Maps/sec                                Data Maps/sec is the frequency that a file system
                                                    such as NTFS, maps a page of a file into the file
                                                    system cache to read the page.
LogicalDisk($DRIVE)Disk Reads/sec
LogicalDisk($DRIVE)Disk Read Bytes/sec
LogicalDisk($DRIVE)Disk Writes/sec
LogicalDisk($DRIVE)Disk Write Bytes/sec
LogicalDisk($DRIVE)Avg. Disk Read Queue Length
LogicalDisk($DRIVE)Avg. Disk Write Queue Length
LogicalDisk($DRIVE)Current Disk Queue Length      is the number of requests outstanding on the disk at
                                                    the time the performance data is collected. ...
                                                    Requests experience delays proportional to the length
                                                    of this queue minus the number of spindles on the
                                                    disks. For good performance, this difference should
                                                    average less than two.
LogicalDisk($DRIVE)Split IO/sec                   reports the rate at which I/Os to the disk were split
                                                    into multiple I/Os. A split I/O may result from
                                                    requesting data of a size that is too large to fit into a
                                                    single I/O or that the disk is fragmented.

       Use sed to convert $DRIVE to actual drive:
       sed s/$DRIVE/d:pathtoddrive/g master.cfg > logman_drive.cfg
What to log at Firebird level

Process(fb_inet_server#1)% Processor Time
Process(fb_inet_server#1)IO Read Operations/sec
Process(fb_inet_server#1)IO Write Operations/sec
Process(fb_inet_server#1)Virtual Bytes
Process(fb_inet_server#1)Working Set



     Note syntax for fb_inet_server processes.
     You can log as many fb_inet_server processes as you
    want, even if they don't exist.
Start logman

Just use:

logman start counterset
Logman – useful things to know
logman -? prints the help screen
logman query will list all known configs
and show their status.
logman stop configname will stop a run-
ning config. Useful if you kill a batch file.
Otherwise the dataset just keeps increasing.
logman delete configname will do exactly
what it says on the tin.
OK, we've got some data.
         Now What?
 That is a good question.
 Step One – analyse it for anomalies. Data
caches are usually the problem.
 Once all caching is disabled we can start to
run meaningful tests to compare, say, a
single user with ten concurrent users.
Estimating required IOPS




 With the table above we can start to guestimate our
requirements with one of the following:
POTENTIAL_WIOPS = NUM_DISKS * DISK_WIOPS
or
POTENTIAL_RIOPS = NUM_DISKS * DISK_RIOPS
Don't forget the write penalty

If the test envionment is using a different
disc sub-system to the target production en-
vironment then be sure to account for the
RAID write penalty.
You need to look at the split between
WIOPS and RIOPS and adjust accordingly.
Summary

We've looked at two different ways of
measuring Firebird disc I/O.
We've seen some of the caveats required
when studying the data results.
We've made a start at estimating disc sub-
system requirements for Firebird.

Contenu connexe

Tendances

PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...Equnix Business Solutions
 
Out of the box replication in postgres 9.4(pg confus)
Out of the box replication in postgres 9.4(pg confus)Out of the box replication in postgres 9.4(pg confus)
Out of the box replication in postgres 9.4(pg confus)Denish Patel
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PGConf APAC
 
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-Consulting
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoverySteven Francia
 
MongoDB memory management demystified
MongoDB memory management demystifiedMongoDB memory management demystified
MongoDB memory management demystifiedAlon Horev
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Command Prompt., Inc
 
Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4Denish Patel
 
Building a High Performance Analytics Platform
Building a High Performance Analytics PlatformBuilding a High Performance Analytics Platform
Building a High Performance Analytics PlatformSantanu Dey
 
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBEVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBScott Mansfield
 
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptxThink_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptxPayal Singh
 
Hardware Provisioning for MongoDB
Hardware Provisioning for MongoDBHardware Provisioning for MongoDB
Hardware Provisioning for MongoDBMongoDB
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALEPostgreSQL Experts, Inc.
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDBMongoDB
 

Tendances (19)

PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
 
Rit 2011 ats
Rit 2011 atsRit 2011 ats
Rit 2011 ats
 
Out of the box replication in postgres 9.4(pg confus)
Out of the box replication in postgres 9.4(pg confus)Out of the box replication in postgres 9.4(pg confus)
Out of the box replication in postgres 9.4(pg confus)
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
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...
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster Recovery
 
MongoDB memory management demystified
MongoDB memory management demystifiedMongoDB memory management demystified
MongoDB memory management demystified
 
Shootout at the AWS Corral
Shootout at the AWS CorralShootout at the AWS Corral
Shootout at the AWS Corral
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
 
Backups
BackupsBackups
Backups
 
Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4
 
Building a High Performance Analytics Platform
Building a High Performance Analytics PlatformBuilding a High Performance Analytics Platform
Building a High Performance Analytics Platform
 
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBEVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptxThink_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
 
Hardware Provisioning for MongoDB
Hardware Provisioning for MongoDBHardware Provisioning for MongoDB
Hardware Provisioning for MongoDB
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALE
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDB
 

Similaire à Measuring Firebird Disk I/O

Sequential file programming patterns and performance with .net
Sequential  file programming patterns and performance with .netSequential  file programming patterns and performance with .net
Sequential file programming patterns and performance with .netMichael Pavlovsky
 
Java File I/O Performance Analysis - Part I - JCConf 2018
Java File I/O Performance Analysis - Part I - JCConf 2018Java File I/O Performance Analysis - Part I - JCConf 2018
Java File I/O Performance Analysis - Part I - JCConf 2018Michael Fong
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementJ Singh
 
computer hardware component.pdf
computer hardware component.pdfcomputer hardware component.pdf
computer hardware component.pdfMuhammad407018
 
Mastering InnoDB Diagnostics
Mastering InnoDB DiagnosticsMastering InnoDB Diagnostics
Mastering InnoDB Diagnosticsguest8212a5
 
Harrison fisk masteringinnodb-diagnostics
Harrison fisk masteringinnodb-diagnosticsHarrison fisk masteringinnodb-diagnostics
Harrison fisk masteringinnodb-diagnosticsguest8212a5
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in LinuxRaghu Udiyar
 
5.6 Basic computer structure microprocessors
5.6 Basic computer structure   microprocessors5.6 Basic computer structure   microprocessors
5.6 Basic computer structure microprocessorslpapadop
 
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...brettallison
 
data stage-material
data stage-materialdata stage-material
data stage-materialRajesh Kv
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimizationManish Rawat
 
Ds8000 Practical Performance Analysis P04 20060718
Ds8000 Practical Performance Analysis P04 20060718Ds8000 Practical Performance Analysis P04 20060718
Ds8000 Practical Performance Analysis P04 20060718brettallison
 
Mirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVMMirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVMKazimal Abed Mohammed
 
Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: RevisionDamian T. Gordon
 
Leveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN PerformanceLeveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN Performancebrettallison
 

Similaire à Measuring Firebird Disk I/O (20)

SQL 2005 Disk IO Performance
SQL 2005 Disk IO PerformanceSQL 2005 Disk IO Performance
SQL 2005 Disk IO Performance
 
IO Dubi Lebel
IO Dubi LebelIO Dubi Lebel
IO Dubi Lebel
 
Vmfs
VmfsVmfs
Vmfs
 
Sequential file programming patterns and performance with .net
Sequential  file programming patterns and performance with .netSequential  file programming patterns and performance with .net
Sequential file programming patterns and performance with .net
 
Java File I/O Performance Analysis - Part I - JCConf 2018
Java File I/O Performance Analysis - Part I - JCConf 2018Java File I/O Performance Analysis - Part I - JCConf 2018
Java File I/O Performance Analysis - Part I - JCConf 2018
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage Management
 
computer hardware component.pdf
computer hardware component.pdfcomputer hardware component.pdf
computer hardware component.pdf
 
os
osos
os
 
Demo 0.9.4
Demo 0.9.4Demo 0.9.4
Demo 0.9.4
 
Mastering InnoDB Diagnostics
Mastering InnoDB DiagnosticsMastering InnoDB Diagnostics
Mastering InnoDB Diagnostics
 
Harrison fisk masteringinnodb-diagnostics
Harrison fisk masteringinnodb-diagnosticsHarrison fisk masteringinnodb-diagnostics
Harrison fisk masteringinnodb-diagnostics
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in Linux
 
5.6 Basic computer structure microprocessors
5.6 Basic computer structure   microprocessors5.6 Basic computer structure   microprocessors
5.6 Basic computer structure microprocessors
 
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...Avoiding Chaos:  Methodology for Managing Performance in a Shared Storage A...
Avoiding Chaos: Methodology for Managing Performance in a Shared Storage A...
 
data stage-material
data stage-materialdata stage-material
data stage-material
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimization
 
Ds8000 Practical Performance Analysis P04 20060718
Ds8000 Practical Performance Analysis P04 20060718Ds8000 Practical Performance Analysis P04 20060718
Ds8000 Practical Performance Analysis P04 20060718
 
Mirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVMMirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVM
 
Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: Revision
 
Leveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN PerformanceLeveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN Performance
 

Plus 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 tablesMind The Firebird
 
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 easilyMind 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 providerMind The Firebird
 
How Firebird transactions work
How Firebird transactions workHow Firebird transactions work
How Firebird transactions workMind The Firebird
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceMind The Firebird
 
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 FirebirdSQLMind The Firebird
 
Firebird Performance counters in details
Firebird Performance counters in detailsFirebird Performance counters in details
Firebird Performance counters in detailsMind The Firebird
 
Understanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLUnderstanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLMind The Firebird
 
Threading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyondThreading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyondMind The Firebird
 
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 KhorsunMind The Firebird
 
Orphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and LoggingOrphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and LoggingMind The Firebird
 
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/2016Mind The Firebird
 
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...Mind The Firebird
 
Working with Large Firebird databases
Working with Large Firebird databasesWorking with Large Firebird databases
Working with Large Firebird databasesMind The Firebird
 
Stored procedures in Firebird
Stored procedures in FirebirdStored procedures in Firebird
Stored procedures in FirebirdMind The Firebird
 
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...Mind The Firebird
 

Plus 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
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performance
 
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
 
Threading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyondThreading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyond
 
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
 
Orphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and LoggingOrphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and Logging
 
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...
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Measuring Firebird Disk I/O

  • 1. Measuring Firebird Disc I/O Paul Reeves IBPhoenix
  • 2. Introduction Disc I/O is one of the main bottlenecks in Firebird. A good disc array can give a massive increase in available IOPS. The question is how do we measure our disc I/O requirements?
  • 3. Two Basic Ways To Measure IO From within Firebird itself From the host O/S
  • 4. Measuring I/O from Firebird Firebird knows what it has done – MON$IO_STATS allows us to catch this info. Portable across platforms and architecures Works wih all versions since Fb 2.1 Sort of a work in progress -enhanced in 2.5
  • 5. MON$IO_STATS Firebird tracks four IO counters Page Reads - physical reads from disc Page Writes – physical writes to disc Page Fetches – pages read from memory Page Marks – pages marked in memory for writing to disc.
  • 6. About Fetches Mostly we can ignore Fetches but be sure to make sure that the cache is big enough otherwise excessive reads will occur. Be sure to tune DB Cache before drawing any conclusions about Firebird disc I/O.
  • 7. Understanding How the MON$ tables work All the Firebird monitoring tables run within snapshot table stability transactions. You need to start a new transaction to see the latest data in the monitoring tables. Historic data is not stored. Once a transaction is finished or an attach- ment is disconnected the details disappear from the monitoring tables. Cumulative database level stats requires persistent connections. This means that even database level stats are lost if all con- nections to the database are closed.
  • 8. Making Stats persist - DBTriggers DB Triggers available at Connection and Transaction Level. Stats are stored at Attachment and Trans- action Level (amongst others.) Solution – catch stats at end of Connection or Transaction.
  • 9. Capturing Txn Stats Initial analysis indicated that txn level stats may not be complete – more study required. Worse – Txn commit triggers and read only transactions don't mix.
  • 10. Capturing Connection Level Stats Stats seem to be complete(ish). No problems with r/o txns.
  • 11. A table to store the data CREATE TABLE PERSISTENT_IO_STATS ( PERSISTENT_IO_STATS_ID INTEGER NOT NULL, LOG_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL MON$STAT_ID INTEGER, MON$STAT_GROUP SMALLINT, MON$PAGE_READS BIGINT, MON$PAGE_WRITES BIGINT, MON$PAGE_FETCHES BIGINT, MON$PAGE_MARKS BIGINT, MON$REMOTE_ADDRESS VARCHAR(253), MON$REMOTE_PROCESS VARCHAR(253), MON$USER CHAR(31), MON$ATTACHMENT_ID INTEGER, DURATION BIGINT, CONSTRAINT PK_PERSISTENT_IO_STATS PRIMARY KEY (PERSISTENT_IO_STATS_ID) );
  • 12. And a trigger to capture it with...
  • 13. Add a couple of Stored Procs... And we can start to analyse our disc I/O by Application, User, IP address.
  • 14. Add a couple of Stored Procs... And we can start to analyse our disc I/O by Application, User, IP address.
  • 15. Problems with MON$IO_STATS Attachment level stats are almost complete – except that SS doesn't include back- ground threads. Accurate stats can only be acquired by running Classic. Long running attachments will produce rub- bish stats if tracking IOPS is the goal. But well written applications do not leave connections open – do they?.
  • 16. Using the host O/S for monitoring All? modern O/S have monitoring and dia- gnostic tools. We'll take a look at the one that comes with Windows.
  • 17. Setting up perfmon Perfmon has one of the worst gui designs I have ever seen. Fortunately we don't have to use it. We use logman instead. Logman is the script interface to the perf- mon counters.
  • 18. Register a counter set for logman Typical command-line: logman.exe create counter configname -cf d:pathtodconfig.cfg -f csv --v -o d:pathtodoutputfile -y -si 1 These options mean: Param Description -cf Name of config file -f csv Use csv file format --v Attach file versioning information to the end of the log name -o Output path and file name -y Answer yes to all questions without prompting -si 1 Sample interval in seconds.
  • 19. What to log at disc level? Counter Description CacheData Maps/sec Data Maps/sec is the frequency that a file system such as NTFS, maps a page of a file into the file system cache to read the page. LogicalDisk($DRIVE)Disk Reads/sec LogicalDisk($DRIVE)Disk Read Bytes/sec LogicalDisk($DRIVE)Disk Writes/sec LogicalDisk($DRIVE)Disk Write Bytes/sec LogicalDisk($DRIVE)Avg. Disk Read Queue Length LogicalDisk($DRIVE)Avg. Disk Write Queue Length LogicalDisk($DRIVE)Current Disk Queue Length is the number of requests outstanding on the disk at the time the performance data is collected. ... Requests experience delays proportional to the length of this queue minus the number of spindles on the disks. For good performance, this difference should average less than two. LogicalDisk($DRIVE)Split IO/sec reports the rate at which I/Os to the disk were split into multiple I/Os. A split I/O may result from requesting data of a size that is too large to fit into a single I/O or that the disk is fragmented. Use sed to convert $DRIVE to actual drive: sed s/$DRIVE/d:pathtoddrive/g master.cfg > logman_drive.cfg
  • 20. What to log at Firebird level Process(fb_inet_server#1)% Processor Time Process(fb_inet_server#1)IO Read Operations/sec Process(fb_inet_server#1)IO Write Operations/sec Process(fb_inet_server#1)Virtual Bytes Process(fb_inet_server#1)Working Set Note syntax for fb_inet_server processes. You can log as many fb_inet_server processes as you want, even if they don't exist.
  • 21. Start logman Just use: logman start counterset
  • 22. Logman – useful things to know logman -? prints the help screen logman query will list all known configs and show their status. logman stop configname will stop a run- ning config. Useful if you kill a batch file. Otherwise the dataset just keeps increasing. logman delete configname will do exactly what it says on the tin.
  • 23. OK, we've got some data. Now What? That is a good question. Step One – analyse it for anomalies. Data caches are usually the problem. Once all caching is disabled we can start to run meaningful tests to compare, say, a single user with ten concurrent users.
  • 24. Estimating required IOPS With the table above we can start to guestimate our requirements with one of the following: POTENTIAL_WIOPS = NUM_DISKS * DISK_WIOPS or POTENTIAL_RIOPS = NUM_DISKS * DISK_RIOPS
  • 25. Don't forget the write penalty If the test envionment is using a different disc sub-system to the target production en- vironment then be sure to account for the RAID write penalty. You need to look at the split between WIOPS and RIOPS and adjust accordingly.
  • 26. Summary We've looked at two different ways of measuring Firebird disc I/O. We've seen some of the caveats required when studying the data results. We've made a start at estimating disc sub- system requirements for Firebird.