SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
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.

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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...
 

Kürzlich hochgeladen

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Kürzlich hochgeladen (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

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.