SlideShare a Scribd company logo
1 of 60
Download to read offline
“The database is so fast. I don't
 know if we'll ever max it out.”
                     -- Not Your Client, Inc.
“My database is slow.”
        -- Every Single Support Client LLC
Performance
Whack-a-Mole
Part 1:
The Rules
The Stack


   Queries     Transactions             Application


   Drivers     Connections    Caching   Middleware

   Schema        Config                   Database


  Filesystem     Kernel            Operating System


   Storage      RAM/CPU       Network     Hardware
The Stack


   Queries     Transactions             Application


   Drivers     Connections    Caching   Middleware

   Schema        Config                   Database


  Filesystem     Kernel            Operating System


   Storage      RAM/CPU       Network     Hardware
The Stack


            Application

            Middleware


             Database

                OS


                HW
Rules of Whack-a-Mole
1.Most “database performance problems”, or
  Moles, are not actually database performance
  problems.
The Hockey Stick
Affect on Performance




                        Ranked Issues
The Hockey Stick
Affect on Performance




                        Ranked Issues
Rules of Whack-a-Mole
1.Most “database performance problems”, or
  Moles, are not actually database performance
  problems.
2.Less than 10% of Moles cause 90% of
  performance degradation.
  ● corollary: we don't care about the other 90% of Moles
The Hockey Stick
Affect on Performance




                        Ranked Issues
Rules of Whack-a-Mole
1.Most “database performance problems”, or
  Moles, are not actually database performance
  problems.
2.Less than 10% of Moles cause 90% of
  performance degradation.
  ● corollary: we don't care about the other 90% of Moles
3.At any time, it is usually only possible to observe
  and troubleshoot the “largest” Mole.
What Color Is My Application?
W ►Web Application (Web)
     ●DB smaller than RAM
     ●90% or more simple read queries
O ►Online Transaction Processing (OLTP)
     ●DB slightly larger than RAM to 1TB
     ●20-40% small data write queries
     ●Some long transactions
D ►Data Warehousing (DW)
     ●Large to huge databases (100GB to 100TB)
     ●Large complex reporting queries
     ●Large bulk loads of data
     ●Also called "Decision Support" or "Business Intelligence"
What Color Is My Application?
W ►Web Application (Web)
     ●CPU-bound
     ●Moles: caching, pooling, connection time
O ►Online Transaction Processing (OLTP)
     ●CPU or I/O bound
     ●Moles: locks, cache, transactions, write speed, log


D ►Data Warehousing (DW)
     ●I/O or RAM bound
     ●Moles: seq scans, resources, bad queries
Rules of Whack-a-Mole
1.Most “database performance problems”, or
  Moles, are not actually database performance
  problems.
2.Less than 10% of Moles cause 90% of
  performance degradation.
  ● corollary: we don't care about the other 90% of Moles
3.At any time, it is usually only possible to observe
  and troubleshoot, or Whack, the “largest” Mole.
4.Different application types usually have different
  Moles and need different troubleshooting.
Part 2:
Baseline
What's a Baseline?
►Gather information about the system
  ●you need to know what's happening at every level of the
   stack
  ●identify potential trouble areas to come back to later
►Basic Setup
  ●check the hardware/OS setup for sanity
  ●apply the conventional postgresql.conf calculations
  ●do conventional wisdom middleware and application setup
  ●should be fast run-though, like an hour
Why Baseline?
►Why not just go straight to Whacking?
  ●extremely poor basic setup may mask more serious issues
  ●baseline setup may turn out to be all that's needed
  ●deviations from baseline can be clues to finding Moles
  ●baseline will make your setup comparable to other
   installations so you can check tests
  ●clients/sysadmins/developers are seldom a reliable source of
   bottleneck information
Steps for Baseline


      1.Hardware setup
      2.Filesystem & OS Setup
      3.Database Configuration
      4.Drivers, Pooling & Caching
      5.Application Setup Information
Steps for Baseline


5.    Queries     Transactions             Application

4.    Drivers     Connections    Caching   Middleware

3.    Schema        Config                   Database


2.   Filesystem     Kernel            Operating System


1.    Storage      RAM/CPU       Network     Hardware
Steps for Baseline


1.    Queries     Transactions             Application

2.    Drivers     Connections    Caching   Middleware

3.    Schema        Config                   Database


4.   Filesystem     Kernel            Operating System


5.    Storage      RAM/CPU       Network     Hardware
Hardware Baseline
►Gather Data
  ●Server
    ▬   CPU model, speed, number, arch
    ▬   RAM quantity, speed, configuration
  ●Storage
    ▬   Interface (cards, RAID)
    ▬   Disk type, size, speed
    ▬   Array/SAN configuration
  ●Network
    ▬   network type and bandwith
    ▬   devices and models
    ▬   switch/routing configuration
Hardware Baseline
►Baseline
  ●Storage
    ▬   Use appropriate RAID configuration
    ▬   Turn on write caching if safe
    ▬   Make sure you're using all channels/devices
  ●Network
    ▬   application servers & DB server should be on dedicated
        network
    ▬   use redundant connections & load balancing if available
Operating System Baseline
►OS
 ●gather data
      ▬   OS, version, patch level, any modifications made
      ▬   hardware driver information
      ▬   system usage by other applications (& resource usage)
 ●baseline
      ▬   update to latest patch level (probably)
      ▬   update hardware drivers (probably)
      ▬   migrate conflicting applications
           –   other DBMSes
           –   other applications with heavy HW usage
Operating System Baseline
►Filesystem
  ●gather data
     ▬   filesystem type, partitions
     ▬   locations of files for OS, Database, other apps
     ▬   filesystem settings
  ●baseline
     ▬   move transaction log to separate disk/array/partition
     ▬   set filesystem for general recommendations
          –   lower journaling levels
          –   directio for xlog (if possible)
          –   aggressive caching for DB
          –   other settings specific to FS
Operating System Baseline
►OLTP Server running on Solaris 10
  ●Updated to Update3
     ▬   Fibercard driver patched
  ●Dedicated Server
     ▬   MySQL removed to less critical machine
  ●Solaris settings configured:
          –   set segmapsize=10737418240
          –   set ufs:freebehind=0
          –   set segmap_percent=50
  ●Filesystem configured:
          –   mount -o forcedirectio /dev/rdsk/cntndnsn /mypath/pg_xlog
          –   tunefs -a 128 /mypath/pg_xlog
Database Baseline
►Gather Data
  ●schema
     ▬   tables: design, data size, partitioning, tablespaces
     ▬   indexes
     ▬   stored procedures
  ●configuration settings
     ▬   ask about any non-defaults
  ●maintenance
     ▬   have maintenance routines been run?
     ▬   when and with what settings?
Middleware Baseline
►Gather data
  ●DB drivers: driver, version
  ●Connections: method, pooling (if any), pooling configuration
  ●Caching: methods, tools used, versions, cache configuration
  ●ORM: software, version
►Baseline
  ●Update to latest middleware software: drivers, cache, etc.
  ●Utilize all pooling and caching methods available
     ▬   use prepared queries
     ▬   plan, parse, data caching (if available)
     ▬   pool should be sized to the maximum connections needed
     ▬   persistent connections if no pool
Application Baseline
►Gather data
  ●application type
  ●transaction model and volume
  ●query types and relative quantities
     ▬   get some typical queries, or better, logs
  ●stored procedure execution, if any
  ●understand how the application generally works
     ▬   get a use perspective
     ▬   find out purpose and sequence of usage
     ▬   usage patterns: constant or peak traffic?
Part 3:
 Tools for
Mole-Hunting
Types of Tools: HW & OS
►Operating system tools
  ●simple & easy to use, non-invasive
  ●let you monitor hardware usage, gross system characteristics
  ●often the first option to tell what kind of Mole you have
►Benchmarks & microbenchmarks
  ●very invasive: need to take over host system
  ●allow comparable testing of HW & OS
Types of Tools: Database
►database admin views, DTrace
  ●minimally invasive, fast
  ●give you more internal data about what's going on in the DB
   realtime
  ●let you spot schema, query, lock problems
►Database query log
  ●somewhat invasive, slow
  ●allows introspection on specific types of db activity
  ●compute overall statistics on query, DB load
►Query Analysis
  ●troubleshoot “bad queries”
  ●for fixing specific queries only
Types of Tools: Application
►Application server tools
  ●response time analysis tools
  ●database activity monitoring tools
  ●cache usage monitoring
►Workload simulation & screen scraping
  ●the best benchmark is a simulation of your own application
  ●tools like lwp and log replay tools
►Bug detection tools
  ●valgrind, MDB, GDB, DTrace
  ●sometimes your performance issue is a genuine software bug
Part 3a:
 Operating
System Tools
ps
►lets you see running processes
  ●gives you an idea of concurrent activity & memory/cpu usage
  ●lets you spot hung and long-running statements/connections


mpstat
►see CPU activity for each CPU
  ●find out if you're CPU-bound
  ●see if all CPUs are being utilized
  ●detect context-switch issues
vmstat, free
►Watch memory usage
  ●see if RAM is saturated
     ▬   are you not able to cache enough?
     ▬   are you swapping?

iostat
►monitor usage of storage
  ●see if I/O is saturated
  ●see if one storage resource is bottlenecking everything else
  ●watch for checkpoint spikes
Part 3b:
Benchmarks
Benchmarks vs. Microbenchmarks

►Benchmarks
  ●work out multiple areas of performance
  ●require time, effort, hardware to run
  ●create reproduceable results
  ●create comparable results
►Microbenchmarks
  ●work out one area of performance
  ●quick & easy to run
  ●results may not be reproduceable or comparable
Microbenchmarks: bonnie++
►Filesystem performance test
  ●see I/O throughput & issues
  ●check seek, random write speeds
Database Microbenchmarks
►pgbench/Wisconsin/TPCB
  ●tests mostly I/O and connection processing speed
  ●doesn't test locking, computation, or query planning
  ●results sometimes not reproducable
  ●mostly useful to prove large OS+HW issues
     ▬   not useful for fine performance tuning
►OSDB/PolePosition
  ●tests specific database operations
  ●useful to find specific queries/operations to avoid
  ●not useful for general performance tests
Benchmarks: pgbench




               Thanks to Greg Smith for this graph!
Benchmarks: Serious
►Use serious benchmarks only when you have a
 spare systems, or a problem which makes the
 system unusable
  ●you'll have to take the system offline
  ●it gives you reproduceable results to send to vendors &
   mailing lists
  ●best way to go after proven bugs you can't work around
►Each real benchmark tests a different workload
  ●so pick the one closest to yours
Benchmarks: Serious
►DBT Benchmarks
  ●Serious OLTP benchmark
     ▬   based on TPCC
     ▬   reproduceable results, works out a lot more of the system
     ▬   complex & time-consuming to set up, run
►DBT3, DBT5
  ●new OLTP and DW benchmarks
►Others being developed
  ●web2.0
  ●EAstress
Part 4:
Hunting Moles
Hunting Moles
►What kind?
  ●What are the symptoms?
     ▬   response times
     ▬   error messages
►When?
  ●activity which causes the problem
     ▬   general slowdown or specific operation, or periodic?
     ▬   caused just by one activity, or by several?
  ●concurrent system activity
     ▬   system/DB load?
     ▬   what other operations are going on on the system?
Common Types of Moles
►I/O Mole
  ●behavior: cpu underutilized: ram available, I/O saturated for
   at least one device
  ●habitats: [D], [O], any heavy write load or very large database
  ●common causes:
     ▬   bad I/O hardware/software
     ▬   bad I/O config
     ▬   not enough ram
     ▬   too much data requested from application
     ▬   bad schema: missing indexes or partitioning needed
Common Types of Moles
►CPU Mole
 ●behavior: cpus at 90% or more: ram available, I/O not
  saturated
 ●habitats: [W], [O], mostly-read loads or those involving
  complex calculation in queries
 ●causes:
    ▬   too many queries
    ▬   insufficient caching/pooling
    ▬   too much data requested by application
    ▬   bad queries
    ▬   bad schema: missing indexes
 ●can be benign: most DB servers should be CPU-bound at
  maximum load
Common Types of Moles
►Locking Mole
  ●behavior: nothing on DB or App server is at maximum, but
   many queries have long waits, often heavy context switching,
   pg_locks sometimes shows waits
  ●habitats: [O], [D], or loads involving pessimistic locking and/or
   stored procedures
  ●causes:
     ▬   long-running transactions/procedures
     ▬   cursors held too long
     ▬   pessimistic instead of optimistic locking or userlocks
     ▬   poor transaction management (failure to rollback)
     ▬   various buffer settings in .conf too low
     ▬   SMP scalability limits
Common Types of Moles
►Application Mole
  ●behavior: nothing on DB server is at maximum, but RAM or
   CPU on the App servers is completely utilized
  ●habitats: common in J2EE
  ●causes:
     ▬   not enough application servers
     ▬   too much data / too many queries
     ▬   bad caching/pooling config
     ▬   driver issues
     ▬   ORM
Part 4a:
Hunting Moles
  Examples
Slow DW
►Setup
  ●Data warehousing application
  ●Both bulk loads and large reporting queries were very slow
  ●CPU and RAM were OK, and I/O seemed underused
     ▬   except it never got above a very low ceiling
►The Hunt
  ●used dd, bonnie++, iostat to check I/O behavior
  ●throughput of JBOD was much slower than internal disk
  ●compared with similar system by another vendor
►The Whack
  ●the RAID card used in that model was defective, replaced
Checkpoint Spikes
►Setup
  ●OLTP benchmark, but not as fast as MySQL
  ●Nothing was maxxed
  ●Query throughput cycled up and down
►The Hunt
  ●checked iostat, saw 5-minute cycle
  ●installed, checked pg_stat_bgwriter
     ▬   showed high amount of buffers_checkpoint
►The Whack
  ●increased bgwriter frequency, amounts
  ●spikes decreased, overall throughput rose slightly
Connection Management
►The Setup
  ●JSP web application good 23 hours per day, but bombing
   during the peak traffic hour
     ▬   DB server would run out of RAM and stop responding
►The Hunt
  ●watched pg_stat_activity and process list during peak
   periods, took snapshots
     ▬   saw that connections went up to 2000+ during peak, yet many
         of them were idle
     ▬   verified this by logging connections
  ●checked Tomcat configuration
     ▬   connection pool: 200 connections
     ▬   servers were set to reconnect after 10 seconds timeout
Connection Management
►The Whack
 ●Tomcat was “bombing” the database with thousands of failed
  connections
    ▬   faster than the database could fulfill them
 ●Fixed configuration
    ▬   min_connections for pool set to 700
    ▬   connection_timeout and pool connection timeout synchronized
 ●Suggested improvements
    ▬   upgrade to a J2EE architecture with better pooling
Too Many Queries
►The Setup
  ●c++ client-server application took 3+ minutes to start up
►The Hunt
  ●set pg_log to log queries
     ▬   ran application startup
  ●ran through pg_fouine
     ▬   showed over 20,000 queries during startup
     ▬   most of them identical when normalized
►The Whack
  ●the application was walking several large trees, node-by-node
  ●taught the programmers to do batch queries and use
   connect_by()
Undead Transactions
►The Setup
  ●Perl OLTP application was fast when upgraded, but became
   slower & slower with time
►The Hunt
  ●checked db maintenance schedule: vacuum was being run
     ▬   yet pg_tables showed tables were growing faster than they
         should, indexes too
     ▬   vacuum analyze verbose showed lots of “dead tuples could not
         be removed”
  ●checked pg_stat_activity and process list
     ▬   “idle in transaction”
     ▬   some transactions were living for days
Undead Transactions
►The Whack
 ●programmers fixed application bug to rollback failed
  transactions instead of skipping them
 ●added “undead transaction” checker to their application
  monitoring
Is The Mole Dead?
   Yes, which means it's time to move on
             to the next mole.




               Isn't this fun?
Further Questions
►Josh Berkus                                       ►More Advice
  ●josh@postgresql.org                                    ●www.postgresql.org/docs
  ●josh@pgexperts.com                                     ●www.planetpostgresql.org
  ●www.pgexperts.com                                      ●irc.freenode.net
  ●it.toolbox.com/blogs/                                         ▬   #postgresql
   database-soup




                                            Special thanks for borrowed content to:
                                            www.MolePro.com for the WhackaMole Game
                                            Greg Smith for pgbench and bonnie++ results

             This talk is copyright 2008 Josh Berkus, and is licensed under the creative commons attribution license

More Related Content

What's hot

Cassandra Troubleshooting for 2.1 and later
Cassandra Troubleshooting for 2.1 and laterCassandra Troubleshooting for 2.1 and later
Cassandra Troubleshooting for 2.1 and laterJ.B. Langston
 
HDFS NameNode High Availability
HDFS NameNode High AvailabilityHDFS NameNode High Availability
HDFS NameNode High AvailabilityDataWorks Summit
 
Designing Information Structures For Performance And Reliability
Designing Information Structures For Performance And ReliabilityDesigning Information Structures For Performance And Reliability
Designing Information Structures For Performance And Reliabilitybryanrandol
 
Understand and optimize Linux I/O
Understand and optimize Linux I/OUnderstand and optimize Linux I/O
Understand and optimize Linux I/OAndrea Righi
 
Cassandra Troubleshooting (for 2.0 and earlier)
Cassandra Troubleshooting (for 2.0 and earlier)Cassandra Troubleshooting (for 2.0 and earlier)
Cassandra Troubleshooting (for 2.0 and earlier)J.B. Langston
 
Block I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBlock I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBabak Farrokhi
 
Cassandra in Operation
Cassandra in OperationCassandra in Operation
Cassandra in Operationniallmilton
 
HBase Sizing Notes
HBase Sizing NotesHBase Sizing Notes
HBase Sizing Noteslarsgeorge
 
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1DataStax Academy
 
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0sprdd
 
Cassandra Troubleshooting 3.0
Cassandra Troubleshooting 3.0Cassandra Troubleshooting 3.0
Cassandra Troubleshooting 3.0J.B. Langston
 
Hug Hbase Presentation.
Hug Hbase Presentation.Hug Hbase Presentation.
Hug Hbase Presentation.Jack Levin
 
Optimizing your Infrastrucure and Operating System for Hadoop
Optimizing your Infrastrucure and Operating System for HadoopOptimizing your Infrastrucure and Operating System for Hadoop
Optimizing your Infrastrucure and Operating System for HadoopDataWorks Summit
 
20150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.420150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.4Jinkoo Han
 
Hadoop ha system admin
Hadoop ha system adminHadoop ha system admin
Hadoop ha system adminTrieu Dao Minh
 
Strata + Hadoop World 2012: HDFS: Now and Future
Strata + Hadoop World 2012: HDFS: Now and FutureStrata + Hadoop World 2012: HDFS: Now and Future
Strata + Hadoop World 2012: HDFS: Now and FutureCloudera, Inc.
 
[B4]deview 2012-hdfs
[B4]deview 2012-hdfs[B4]deview 2012-hdfs
[B4]deview 2012-hdfsNAVER D2
 
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
 
Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2
Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2
Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2Cloudera, Inc.
 
Hdfs ha using journal nodes
Hdfs ha using journal nodesHdfs ha using journal nodes
Hdfs ha using journal nodesEvans Ye
 

What's hot (20)

Cassandra Troubleshooting for 2.1 and later
Cassandra Troubleshooting for 2.1 and laterCassandra Troubleshooting for 2.1 and later
Cassandra Troubleshooting for 2.1 and later
 
HDFS NameNode High Availability
HDFS NameNode High AvailabilityHDFS NameNode High Availability
HDFS NameNode High Availability
 
Designing Information Structures For Performance And Reliability
Designing Information Structures For Performance And ReliabilityDesigning Information Structures For Performance And Reliability
Designing Information Structures For Performance And Reliability
 
Understand and optimize Linux I/O
Understand and optimize Linux I/OUnderstand and optimize Linux I/O
Understand and optimize Linux I/O
 
Cassandra Troubleshooting (for 2.0 and earlier)
Cassandra Troubleshooting (for 2.0 and earlier)Cassandra Troubleshooting (for 2.0 and earlier)
Cassandra Troubleshooting (for 2.0 and earlier)
 
Block I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBlock I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktrace
 
Cassandra in Operation
Cassandra in OperationCassandra in Operation
Cassandra in Operation
 
HBase Sizing Notes
HBase Sizing NotesHBase Sizing Notes
HBase Sizing Notes
 
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
 
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
 
Cassandra Troubleshooting 3.0
Cassandra Troubleshooting 3.0Cassandra Troubleshooting 3.0
Cassandra Troubleshooting 3.0
 
Hug Hbase Presentation.
Hug Hbase Presentation.Hug Hbase Presentation.
Hug Hbase Presentation.
 
Optimizing your Infrastrucure and Operating System for Hadoop
Optimizing your Infrastrucure and Operating System for HadoopOptimizing your Infrastrucure and Operating System for Hadoop
Optimizing your Infrastrucure and Operating System for Hadoop
 
20150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.420150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.4
 
Hadoop ha system admin
Hadoop ha system adminHadoop ha system admin
Hadoop ha system admin
 
Strata + Hadoop World 2012: HDFS: Now and Future
Strata + Hadoop World 2012: HDFS: Now and FutureStrata + Hadoop World 2012: HDFS: Now and Future
Strata + Hadoop World 2012: HDFS: Now and Future
 
[B4]deview 2012-hdfs
[B4]deview 2012-hdfs[B4]deview 2012-hdfs
[B4]deview 2012-hdfs
 
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
 
Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2
Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2
Strata + Hadoop World 2012: High Availability for the HDFS NameNode Phase 2
 
Hdfs ha using journal nodes
Hdfs ha using journal nodesHdfs ha using journal nodes
Hdfs ha using journal nodes
 

Viewers also liked (20)

Question 2 How effective is the combination of your main product and ancillar...
Question 2 How effective is the combination of your main product and ancillar...Question 2 How effective is the combination of your main product and ancillar...
Question 2 How effective is the combination of your main product and ancillar...
 
Head of Year 7 Information Evening Presentation
Head of Year 7 Information Evening PresentationHead of Year 7 Information Evening Presentation
Head of Year 7 Information Evening Presentation
 
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
5 (more) Ways To Destroy Your Community
5 (more) Ways To Destroy Your Community5 (more) Ways To Destroy Your Community
5 (more) Ways To Destroy Your Community
 
Safety LAMP: data security & agile languages
Safety LAMP: data security & agile languagesSafety LAMP: data security & agile languages
Safety LAMP: data security & agile languages
 
Taylor swift quiz
Taylor swift quizTaylor swift quiz
Taylor swift quiz
 
The jelly baby disaster
The jelly baby disasterThe jelly baby disaster
The jelly baby disaster
 
Narrative theories new
Narrative theories newNarrative theories new
Narrative theories new
 
New pitch
New pitchNew pitch
New pitch
 
HowTo DR
HowTo DRHowTo DR
HowTo DR
 
Writeable CTEs: The Next Big Thing
Writeable CTEs: The Next Big ThingWriteable CTEs: The Next Big Thing
Writeable CTEs: The Next Big Thing
 
Auidence research (hip hop) ryo panis 1
Auidence research (hip hop) ryo panis 1Auidence research (hip hop) ryo panis 1
Auidence research (hip hop) ryo panis 1
 
Question 1
Question 1Question 1
Question 1
 
Options for year 10 parents 2014
Options for year 10 parents 2014Options for year 10 parents 2014
Options for year 10 parents 2014
 
Safe Data is Happy Data
Safe Data is Happy DataSafe Data is Happy Data
Safe Data is Happy Data
 
Front cover magazine analysis of 1&2
Front cover magazine analysis of 1&2Front cover magazine analysis of 1&2
Front cover magazine analysis of 1&2
 
Ppt java
Ppt javaPpt java
Ppt java
 
Open Source Press Relations
Open Source Press RelationsOpen Source Press Relations
Open Source Press Relations
 
Gromit
GromitGromit
Gromit
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 

Similar to Performance Whackamole (short version)

Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Moleoscon2007
 
MariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB plc
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCoburn Watson
 
Tuning Linux for Databases.
Tuning Linux for Databases.Tuning Linux for Databases.
Tuning Linux for Databases.Alexey Lesovsky
 
Алексей Лесовский "Тюнинг Linux для баз данных. "
Алексей Лесовский "Тюнинг Linux для баз данных. "Алексей Лесовский "Тюнинг Linux для баз данных. "
Алексей Лесовский "Тюнинг Linux для баз данных. "Tanya Denisyuk
 
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Amazon Web Services
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMariaDB plc
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMariaDB plc
 
Evergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen ILS
 
Pros_and_Cons_of_DW_Apps pdf.pdf
Pros_and_Cons_of_DW_Apps pdf.pdfPros_and_Cons_of_DW_Apps pdf.pdf
Pros_and_Cons_of_DW_Apps pdf.pdfHernanKlint
 
linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning iman darabi
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...javier ramirez
 
Beat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmarkBeat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmarkPedro González Serrano
 
Performance Tuning
Performance TuningPerformance Tuning
Performance TuningJannet Peetz
 
Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems Baruch Osoveskiy
 
Strata + Hadoop 2015 Slides
Strata + Hadoop 2015 SlidesStrata + Hadoop 2015 Slides
Strata + Hadoop 2015 SlidesJun Liu
 
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...Odinot Stanislas
 
Perfmon And Profiler 101
Perfmon And Profiler 101Perfmon And Profiler 101
Perfmon And Profiler 101Quest Software
 

Similar to Performance Whackamole (short version) (20)

Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
 
Five steps perform_2009 (1)
Five steps perform_2009 (1)Five steps perform_2009 (1)
Five steps perform_2009 (1)
 
MariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & Optimization
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performance
 
Tuning Linux for Databases.
Tuning Linux for Databases.Tuning Linux for Databases.
Tuning Linux for Databases.
 
Алексей Лесовский "Тюнинг Linux для баз данных. "
Алексей Лесовский "Тюнинг Linux для баз данных. "Алексей Лесовский "Тюнинг Linux для баз данных. "
Алексей Лесовский "Тюнинг Linux для баз данных. "
 
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimization
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimization
 
Evergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival Skills
 
Pros_and_Cons_of_DW_Apps pdf.pdf
Pros_and_Cons_of_DW_Apps pdf.pdfPros_and_Cons_of_DW_Apps pdf.pdf
Pros_and_Cons_of_DW_Apps pdf.pdf
 
linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
Beat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmarkBeat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmark
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
 
Performance Tuning
Performance TuningPerformance Tuning
Performance Tuning
 
Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems
 
Strata + Hadoop 2015 Slides
Strata + Hadoop 2015 SlidesStrata + Hadoop 2015 Slides
Strata + Hadoop 2015 Slides
 
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...
 
Perfmon And Profiler 101
Perfmon And Profiler 101Perfmon And Profiler 101
Perfmon And Profiler 101
 

More from PostgreSQL Experts, Inc.

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.
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsPostgreSQL Experts, Inc.
 

More from PostgreSQL Experts, Inc. (20)

Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Shootout at the AWS Corral
Shootout at the AWS CorralShootout at the AWS Corral
Shootout at the AWS Corral
 
Fail over fail_back
Fail over fail_backFail over fail_back
Fail over fail_back
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALE
 
Give A Great Tech Talk 2013
Give A Great Tech Talk 2013Give A Great Tech Talk 2013
Give A Great Tech Talk 2013
 
Pg py-and-squid-pypgday
Pg py-and-squid-pypgdayPg py-and-squid-pypgday
Pg py-and-squid-pypgday
 
92 grand prix_2013
92 grand prix_201392 grand prix_2013
92 grand prix_2013
 
Five steps perform_2013
Five steps perform_2013Five steps perform_2013
Five steps perform_2013
 
7 Ways To Crash Postgres
7 Ways To Crash Postgres7 Ways To Crash Postgres
7 Ways To Crash Postgres
 
PWNage: Producing a newsletter with Perl
PWNage: Producing a newsletter with PerlPWNage: Producing a newsletter with Perl
PWNage: Producing a newsletter with Perl
 
10 Ways to Destroy Your Community
10 Ways to Destroy Your Community10 Ways to Destroy Your Community
10 Ways to Destroy Your Community
 
Preventing Community (from Linux Collab)
Preventing Community (from Linux Collab)Preventing Community (from Linux Collab)
Preventing Community (from Linux Collab)
 
Development of 8.3 In India
Development of 8.3 In IndiaDevelopment of 8.3 In India
Development of 8.3 In India
 
PostgreSQL and MySQL
PostgreSQL and MySQLPostgreSQL and MySQL
PostgreSQL and MySQL
 
50 Ways To Love Your Project
50 Ways To Love Your Project50 Ways To Love Your Project
50 Ways To Love Your Project
 
8.4 Upcoming Features
8.4 Upcoming Features 8.4 Upcoming Features
8.4 Upcoming Features
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and Variants
 
PostgreSQL Development Today: 9.0
PostgreSQL Development Today: 9.0PostgreSQL Development Today: 9.0
PostgreSQL Development Today: 9.0
 
9.1 Mystery Tour
9.1 Mystery Tour9.1 Mystery Tour
9.1 Mystery Tour
 
Postgres Open Keynote: The Next 25 Years
Postgres Open Keynote: The Next 25 YearsPostgres Open Keynote: The Next 25 Years
Postgres Open Keynote: The Next 25 Years
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
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
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"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
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
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
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

Performance Whackamole (short version)

  • 1. “The database is so fast. I don't know if we'll ever max it out.” -- Not Your Client, Inc.
  • 2. “My database is slow.” -- Every Single Support Client LLC
  • 5. The Stack Queries Transactions Application Drivers Connections Caching Middleware Schema Config Database Filesystem Kernel Operating System Storage RAM/CPU Network Hardware
  • 6. The Stack Queries Transactions Application Drivers Connections Caching Middleware Schema Config Database Filesystem Kernel Operating System Storage RAM/CPU Network Hardware
  • 7. The Stack Application Middleware Database OS HW
  • 8. Rules of Whack-a-Mole 1.Most “database performance problems”, or Moles, are not actually database performance problems.
  • 9. The Hockey Stick Affect on Performance Ranked Issues
  • 10. The Hockey Stick Affect on Performance Ranked Issues
  • 11. Rules of Whack-a-Mole 1.Most “database performance problems”, or Moles, are not actually database performance problems. 2.Less than 10% of Moles cause 90% of performance degradation. ● corollary: we don't care about the other 90% of Moles
  • 12. The Hockey Stick Affect on Performance Ranked Issues
  • 13. Rules of Whack-a-Mole 1.Most “database performance problems”, or Moles, are not actually database performance problems. 2.Less than 10% of Moles cause 90% of performance degradation. ● corollary: we don't care about the other 90% of Moles 3.At any time, it is usually only possible to observe and troubleshoot the “largest” Mole.
  • 14. What Color Is My Application? W ►Web Application (Web) ●DB smaller than RAM ●90% or more simple read queries O ►Online Transaction Processing (OLTP) ●DB slightly larger than RAM to 1TB ●20-40% small data write queries ●Some long transactions D ►Data Warehousing (DW) ●Large to huge databases (100GB to 100TB) ●Large complex reporting queries ●Large bulk loads of data ●Also called "Decision Support" or "Business Intelligence"
  • 15. What Color Is My Application? W ►Web Application (Web) ●CPU-bound ●Moles: caching, pooling, connection time O ►Online Transaction Processing (OLTP) ●CPU or I/O bound ●Moles: locks, cache, transactions, write speed, log D ►Data Warehousing (DW) ●I/O or RAM bound ●Moles: seq scans, resources, bad queries
  • 16. Rules of Whack-a-Mole 1.Most “database performance problems”, or Moles, are not actually database performance problems. 2.Less than 10% of Moles cause 90% of performance degradation. ● corollary: we don't care about the other 90% of Moles 3.At any time, it is usually only possible to observe and troubleshoot, or Whack, the “largest” Mole. 4.Different application types usually have different Moles and need different troubleshooting.
  • 18. What's a Baseline? ►Gather information about the system ●you need to know what's happening at every level of the stack ●identify potential trouble areas to come back to later ►Basic Setup ●check the hardware/OS setup for sanity ●apply the conventional postgresql.conf calculations ●do conventional wisdom middleware and application setup ●should be fast run-though, like an hour
  • 19. Why Baseline? ►Why not just go straight to Whacking? ●extremely poor basic setup may mask more serious issues ●baseline setup may turn out to be all that's needed ●deviations from baseline can be clues to finding Moles ●baseline will make your setup comparable to other installations so you can check tests ●clients/sysadmins/developers are seldom a reliable source of bottleneck information
  • 20. Steps for Baseline 1.Hardware setup 2.Filesystem & OS Setup 3.Database Configuration 4.Drivers, Pooling & Caching 5.Application Setup Information
  • 21. Steps for Baseline 5. Queries Transactions Application 4. Drivers Connections Caching Middleware 3. Schema Config Database 2. Filesystem Kernel Operating System 1. Storage RAM/CPU Network Hardware
  • 22. Steps for Baseline 1. Queries Transactions Application 2. Drivers Connections Caching Middleware 3. Schema Config Database 4. Filesystem Kernel Operating System 5. Storage RAM/CPU Network Hardware
  • 23. Hardware Baseline ►Gather Data ●Server ▬ CPU model, speed, number, arch ▬ RAM quantity, speed, configuration ●Storage ▬ Interface (cards, RAID) ▬ Disk type, size, speed ▬ Array/SAN configuration ●Network ▬ network type and bandwith ▬ devices and models ▬ switch/routing configuration
  • 24. Hardware Baseline ►Baseline ●Storage ▬ Use appropriate RAID configuration ▬ Turn on write caching if safe ▬ Make sure you're using all channels/devices ●Network ▬ application servers & DB server should be on dedicated network ▬ use redundant connections & load balancing if available
  • 25. Operating System Baseline ►OS ●gather data ▬ OS, version, patch level, any modifications made ▬ hardware driver information ▬ system usage by other applications (& resource usage) ●baseline ▬ update to latest patch level (probably) ▬ update hardware drivers (probably) ▬ migrate conflicting applications – other DBMSes – other applications with heavy HW usage
  • 26. Operating System Baseline ►Filesystem ●gather data ▬ filesystem type, partitions ▬ locations of files for OS, Database, other apps ▬ filesystem settings ●baseline ▬ move transaction log to separate disk/array/partition ▬ set filesystem for general recommendations – lower journaling levels – directio for xlog (if possible) – aggressive caching for DB – other settings specific to FS
  • 27. Operating System Baseline ►OLTP Server running on Solaris 10 ●Updated to Update3 ▬ Fibercard driver patched ●Dedicated Server ▬ MySQL removed to less critical machine ●Solaris settings configured: – set segmapsize=10737418240 – set ufs:freebehind=0 – set segmap_percent=50 ●Filesystem configured: – mount -o forcedirectio /dev/rdsk/cntndnsn /mypath/pg_xlog – tunefs -a 128 /mypath/pg_xlog
  • 28. Database Baseline ►Gather Data ●schema ▬ tables: design, data size, partitioning, tablespaces ▬ indexes ▬ stored procedures ●configuration settings ▬ ask about any non-defaults ●maintenance ▬ have maintenance routines been run? ▬ when and with what settings?
  • 29. Middleware Baseline ►Gather data ●DB drivers: driver, version ●Connections: method, pooling (if any), pooling configuration ●Caching: methods, tools used, versions, cache configuration ●ORM: software, version ►Baseline ●Update to latest middleware software: drivers, cache, etc. ●Utilize all pooling and caching methods available ▬ use prepared queries ▬ plan, parse, data caching (if available) ▬ pool should be sized to the maximum connections needed ▬ persistent connections if no pool
  • 30. Application Baseline ►Gather data ●application type ●transaction model and volume ●query types and relative quantities ▬ get some typical queries, or better, logs ●stored procedure execution, if any ●understand how the application generally works ▬ get a use perspective ▬ find out purpose and sequence of usage ▬ usage patterns: constant or peak traffic?
  • 31. Part 3: Tools for Mole-Hunting
  • 32. Types of Tools: HW & OS ►Operating system tools ●simple & easy to use, non-invasive ●let you monitor hardware usage, gross system characteristics ●often the first option to tell what kind of Mole you have ►Benchmarks & microbenchmarks ●very invasive: need to take over host system ●allow comparable testing of HW & OS
  • 33. Types of Tools: Database ►database admin views, DTrace ●minimally invasive, fast ●give you more internal data about what's going on in the DB realtime ●let you spot schema, query, lock problems ►Database query log ●somewhat invasive, slow ●allows introspection on specific types of db activity ●compute overall statistics on query, DB load ►Query Analysis ●troubleshoot “bad queries” ●for fixing specific queries only
  • 34. Types of Tools: Application ►Application server tools ●response time analysis tools ●database activity monitoring tools ●cache usage monitoring ►Workload simulation & screen scraping ●the best benchmark is a simulation of your own application ●tools like lwp and log replay tools ►Bug detection tools ●valgrind, MDB, GDB, DTrace ●sometimes your performance issue is a genuine software bug
  • 36. ps ►lets you see running processes ●gives you an idea of concurrent activity & memory/cpu usage ●lets you spot hung and long-running statements/connections mpstat ►see CPU activity for each CPU ●find out if you're CPU-bound ●see if all CPUs are being utilized ●detect context-switch issues
  • 37. vmstat, free ►Watch memory usage ●see if RAM is saturated ▬ are you not able to cache enough? ▬ are you swapping? iostat ►monitor usage of storage ●see if I/O is saturated ●see if one storage resource is bottlenecking everything else ●watch for checkpoint spikes
  • 39. Benchmarks vs. Microbenchmarks ►Benchmarks ●work out multiple areas of performance ●require time, effort, hardware to run ●create reproduceable results ●create comparable results ►Microbenchmarks ●work out one area of performance ●quick & easy to run ●results may not be reproduceable or comparable
  • 40. Microbenchmarks: bonnie++ ►Filesystem performance test ●see I/O throughput & issues ●check seek, random write speeds
  • 41. Database Microbenchmarks ►pgbench/Wisconsin/TPCB ●tests mostly I/O and connection processing speed ●doesn't test locking, computation, or query planning ●results sometimes not reproducable ●mostly useful to prove large OS+HW issues ▬ not useful for fine performance tuning ►OSDB/PolePosition ●tests specific database operations ●useful to find specific queries/operations to avoid ●not useful for general performance tests
  • 42. Benchmarks: pgbench Thanks to Greg Smith for this graph!
  • 43. Benchmarks: Serious ►Use serious benchmarks only when you have a spare systems, or a problem which makes the system unusable ●you'll have to take the system offline ●it gives you reproduceable results to send to vendors & mailing lists ●best way to go after proven bugs you can't work around ►Each real benchmark tests a different workload ●so pick the one closest to yours
  • 44. Benchmarks: Serious ►DBT Benchmarks ●Serious OLTP benchmark ▬ based on TPCC ▬ reproduceable results, works out a lot more of the system ▬ complex & time-consuming to set up, run ►DBT3, DBT5 ●new OLTP and DW benchmarks ►Others being developed ●web2.0 ●EAstress
  • 46. Hunting Moles ►What kind? ●What are the symptoms? ▬ response times ▬ error messages ►When? ●activity which causes the problem ▬ general slowdown or specific operation, or periodic? ▬ caused just by one activity, or by several? ●concurrent system activity ▬ system/DB load? ▬ what other operations are going on on the system?
  • 47. Common Types of Moles ►I/O Mole ●behavior: cpu underutilized: ram available, I/O saturated for at least one device ●habitats: [D], [O], any heavy write load or very large database ●common causes: ▬ bad I/O hardware/software ▬ bad I/O config ▬ not enough ram ▬ too much data requested from application ▬ bad schema: missing indexes or partitioning needed
  • 48. Common Types of Moles ►CPU Mole ●behavior: cpus at 90% or more: ram available, I/O not saturated ●habitats: [W], [O], mostly-read loads or those involving complex calculation in queries ●causes: ▬ too many queries ▬ insufficient caching/pooling ▬ too much data requested by application ▬ bad queries ▬ bad schema: missing indexes ●can be benign: most DB servers should be CPU-bound at maximum load
  • 49. Common Types of Moles ►Locking Mole ●behavior: nothing on DB or App server is at maximum, but many queries have long waits, often heavy context switching, pg_locks sometimes shows waits ●habitats: [O], [D], or loads involving pessimistic locking and/or stored procedures ●causes: ▬ long-running transactions/procedures ▬ cursors held too long ▬ pessimistic instead of optimistic locking or userlocks ▬ poor transaction management (failure to rollback) ▬ various buffer settings in .conf too low ▬ SMP scalability limits
  • 50. Common Types of Moles ►Application Mole ●behavior: nothing on DB server is at maximum, but RAM or CPU on the App servers is completely utilized ●habitats: common in J2EE ●causes: ▬ not enough application servers ▬ too much data / too many queries ▬ bad caching/pooling config ▬ driver issues ▬ ORM
  • 52. Slow DW ►Setup ●Data warehousing application ●Both bulk loads and large reporting queries were very slow ●CPU and RAM were OK, and I/O seemed underused ▬ except it never got above a very low ceiling ►The Hunt ●used dd, bonnie++, iostat to check I/O behavior ●throughput of JBOD was much slower than internal disk ●compared with similar system by another vendor ►The Whack ●the RAID card used in that model was defective, replaced
  • 53. Checkpoint Spikes ►Setup ●OLTP benchmark, but not as fast as MySQL ●Nothing was maxxed ●Query throughput cycled up and down ►The Hunt ●checked iostat, saw 5-minute cycle ●installed, checked pg_stat_bgwriter ▬ showed high amount of buffers_checkpoint ►The Whack ●increased bgwriter frequency, amounts ●spikes decreased, overall throughput rose slightly
  • 54. Connection Management ►The Setup ●JSP web application good 23 hours per day, but bombing during the peak traffic hour ▬ DB server would run out of RAM and stop responding ►The Hunt ●watched pg_stat_activity and process list during peak periods, took snapshots ▬ saw that connections went up to 2000+ during peak, yet many of them were idle ▬ verified this by logging connections ●checked Tomcat configuration ▬ connection pool: 200 connections ▬ servers were set to reconnect after 10 seconds timeout
  • 55. Connection Management ►The Whack ●Tomcat was “bombing” the database with thousands of failed connections ▬ faster than the database could fulfill them ●Fixed configuration ▬ min_connections for pool set to 700 ▬ connection_timeout and pool connection timeout synchronized ●Suggested improvements ▬ upgrade to a J2EE architecture with better pooling
  • 56. Too Many Queries ►The Setup ●c++ client-server application took 3+ minutes to start up ►The Hunt ●set pg_log to log queries ▬ ran application startup ●ran through pg_fouine ▬ showed over 20,000 queries during startup ▬ most of them identical when normalized ►The Whack ●the application was walking several large trees, node-by-node ●taught the programmers to do batch queries and use connect_by()
  • 57. Undead Transactions ►The Setup ●Perl OLTP application was fast when upgraded, but became slower & slower with time ►The Hunt ●checked db maintenance schedule: vacuum was being run ▬ yet pg_tables showed tables were growing faster than they should, indexes too ▬ vacuum analyze verbose showed lots of “dead tuples could not be removed” ●checked pg_stat_activity and process list ▬ “idle in transaction” ▬ some transactions were living for days
  • 58. Undead Transactions ►The Whack ●programmers fixed application bug to rollback failed transactions instead of skipping them ●added “undead transaction” checker to their application monitoring
  • 59. Is The Mole Dead? Yes, which means it's time to move on to the next mole. Isn't this fun?
  • 60. Further Questions ►Josh Berkus ►More Advice ●josh@postgresql.org ●www.postgresql.org/docs ●josh@pgexperts.com ●www.planetpostgresql.org ●www.pgexperts.com ●irc.freenode.net ●it.toolbox.com/blogs/ ▬ #postgresql database-soup Special thanks for borrowed content to: www.MolePro.com for the WhackaMole Game Greg Smith for pgbench and bonnie++ results This talk is copyright 2008 Josh Berkus, and is licensed under the creative commons attribution license