SlideShare a Scribd company logo
Check Please!
                  What your Postgres database wishes you would monitor




                                   / Presentation



Friday, May 21, 2010
Who am I?


                       •   Lead Database Operations at OmniTI

                           •   Database Consulting / Management

                       •   Postgres?

                           •   TB+ OLAP/DSS

                           •   multiple 1000+ tps OLTP

                           •   custom built, private label

                           •   long time user (6.5-9.x)

                               •   community member

                               •   major contributor




Friday, May 21, 2010
Check Yourself!




                       •   Basic Tuning Is Job #1

                           •   shared buffers, effective cache size, checkpoints

                       •   Resources

                           •   http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server

                           •   http://www.slideshare.net/xzilla/the-essential-postgresqlconf-presentation




Friday, May 21, 2010
Before You Wreck Yourself!




Friday, May 21, 2010
Before You Wreck Yourself!



            •          Monitoring

                  •      If a server crashes in the woods

                  •      Pain is a great motivator




Friday, May 21, 2010
Before You Wreck Yourself!




Friday, May 21, 2010
Before You Wreck Yourself!
                       •   Trending

                           •   Knowing what things look like when they’re good helps determine
                               when things are bad

                           •   You can often tell where you’re going by looking at where you came
                               from




Friday, May 21, 2010
Tools?




                       •   Tools cannot replace experience and discipline

                           •   But they can help you maintain that discipline

                       •   Popular tools

                           •   nagios / munin

                           •   cacti / mrtg

                           •   circonus.com / reconnoiter

                           •   { check_postgres }




Friday, May 21, 2010
Connections


   •      Hard limit on allowed connections




   •      Game Over



   •      Large numbers of concurrent
          users

   •      Internet facing systems
                                              - Paul RJ Muller, beached whale




Friday, May 21, 2010
Disk Space


   •      Data, clog, xlogs, log files




   •      Game Over

   •      (planning)




   •      Everybody


                                        - Squiggle, Overloaded?




Friday, May 21, 2010
WAL Files

   •      pg_xlog directory, transaction logs

   •      maintain database consistency



   •      excessive disk space

   •      excessive recovery time


   •      heavy write transactions

   •      pg start/stop backup (buggy systems)
                                                 - Jazzmasterson, Workspace 3.0 - Noguchi File




Friday, May 21, 2010
Size Matters

   •      more data == more disk space

   •      only grow if you should



   •      large tables, i/o issues

   •      unbounded growth?


   •      fast paced development

   •      everyone else (eventually)

                                         - elmada, Size Matters




Friday, May 21, 2010
Bloating

   •      mvcc leaves dead rows

   •      unused space in tables, indexes



   •      i/o issues

   •      disk space (eventually)


   •      heavy updates, data churn

   •      untuned systems

                                            - Joe Alterio, burpalurpa




Friday, May 21, 2010
Transactions

   •      every statement is in a transaction

   •      select/insert/update/deletes



   •      underlying effects

   •      load spikes


   •      OLTP Systems

   •      Logging/Internet Facing Systems

                                                - laurieofindy , Walmart on Black Friday 2009




Friday, May 21, 2010
All Stats

   •      pg_stat tables

   •      tables, indexes... scans, tuples



   •      underlying effects

   •      load spikes


   •      OLTP Systems

   •      Logging/Internet Facing Systems

                                             - Inju, Statistics for the Utterly Confused




Friday, May 21, 2010
Free Space Map

   •      Tracks unused space

   •      Keeps vacuum effective



   •      Table / Index Bloat




   •      Medium to Large Systems

   •      High Update / Data Churn DB
                                        - SkyTruth, Deepwater Horizon Oil Spill - RADARSAT-2, May 8, 2010




Friday, May 21, 2010
Autovacuum Max Freeze Age

   •      Ensures all tables get vacuumed

   •      Prevents XID wrap-around



   •      Heavy I/O

   •      Locking Issues


   •      High TPS / OLTP

   •      pg_dump

                                            - Joe Marinaro, Good Morning!




Friday, May 21, 2010
Long Running Queries

   •      postgres can’t freeze query plans

   •      pg_stat_activity



   •      Can cause issues for vacuum

   •      Uh, response time obligations


   •      active data collection

   •      developers write queries ;-)

                                              - _Tawcan, Spiral Out..keep going




Friday, May 21, 2010
Idle Transactions

   •      BEGIN; zzz...

   •      pg_stat_activity



   •      Can cause issues for vacuum

   •      Connections holding memory




   •      pretty much everyone


                                        - psd, Canadian Cashpoints, Bah!




Friday, May 21, 2010
Sequence limits

   •      sequences limited to 2 billion

   •      non-transactional




   •      Can break inserts




   •      Heavy insert (update?) systems


                                           - gavinzac, Rise and Fall in Donegal




Friday, May 21, 2010
Wrap-around


   •      Postgres must vacuum every table
          within 2 Billion transactions




   •      Catastrophic data loss




   •      pretty much everyone


                                             - Jurvetson, Wrapped Around the Axle




Friday, May 21, 2010
Settings


   •      postgresql.conf doesn’t always
          reflect reality




   •      temporary changes can lead
          to long term trouble




   •      pretty much everyone


                                           - denovich, P9220453.jpg




Friday, May 21, 2010
Thanks!




                       •   PGCon

                       •   PGCommunity

                       •   OmniTI

                       •   Want more?

                           •   xzilla@users.sourceforge.net, http://www.xzilla.net

                           •   @robtreat2

                           •   robert@omniti.com, http://www.omniti.com/is/hiring




Friday, May 21, 2010

More Related Content

PDF
web archiving tools and technologies
PDF
Intro to Postgres 8.4 Tutorial
PDF
Pro Postgres 9
PDF
Cocoa for Scientists
PDF
Big Bad "Upgraded" Postgres
PDF
Yet Another Replication Tool: RubyRep
PDF
Mastering Xcode 3
PDF
Building a successful open source consulting company
web archiving tools and technologies
Intro to Postgres 8.4 Tutorial
Pro Postgres 9
Cocoa for Scientists
Big Bad "Upgraded" Postgres
Yet Another Replication Tool: RubyRep
Mastering Xcode 3
Building a successful open source consulting company

Similar to Check Please! (20)

PDF
ScaleCamp 2009 - Last.fm vs Xbox
PDF
Forward
PDF
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
PDF
PyCon 2011 Scaling Disqus
PDF
DFW WP Buddypress Presentation
PDF
Odnoklassniki.ru Architecture
PDF
Playing between the clouds - Better Software 2010
PDF
Eclipse Con 2010 PTP
PDF
Email Design 101
PDF
PyData Texas 2015 Keynote
PDF
Availability, the Cloud and Everything
PDF
Cassandra Summit 2014: Diagnosing Problems in Production
PDF
Cassandra Summit 2014: Diagnosing Problems in Production
PDF
Groovy 1 7 Update, past, present, future - S2G Forum 2010
PDF
Database Management for 
Real Estate Professionals
PDF
MongoDB is the new MySQL
PDF
The Essential PostgreSQL.conf
PDF
Dan node meetup_socket_talk
PDF
Scaling webappswithrabbitmq
PDF
Hotspot Garbage Collection - Tuning Guide
ScaleCamp 2009 - Last.fm vs Xbox
Forward
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
PyCon 2011 Scaling Disqus
DFW WP Buddypress Presentation
Odnoklassniki.ru Architecture
Playing between the clouds - Better Software 2010
Eclipse Con 2010 PTP
Email Design 101
PyData Texas 2015 Keynote
Availability, the Cloud and Everything
Cassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in Production
Groovy 1 7 Update, past, present, future - S2G Forum 2010
Database Management for 
Real Estate Professionals
MongoDB is the new MySQL
The Essential PostgreSQL.conf
Dan node meetup_socket_talk
Scaling webappswithrabbitmq
Hotspot Garbage Collection - Tuning Guide
Ad

More from Robert Treat (20)

PDF
Advanced Int->Bigint Conversions
PDF
Explaining Explain
PDF
the-lost-art-of-plpgsql
PDF
Managing Chaos In Production: Testing vs Monitoring
PDF
Managing Databases In A DevOps Environment 2016
PDF
Less Alarming Alerts - SRECon 2016
PDF
What Ops Can Learn From Design
PDF
Postgres 9.4 First Look
PDF
Less Alarming Alerts!
PDF
Past, Present, and Pachyderm - All Things Open - 2013
PDF
Managing Databases In A DevOps Environment
PDF
Advanced WAL File Management With OmniPITR
PDF
Scaling with Postgres (Highload++ 2010)
PDF
Intro to Postgres 9 Tutorial
PDF
Database Scalability Patterns
PDF
A Guide To PostgreSQL 9.0
PPT
Scaling With Postgres
PDF
Intro to pl/PHP Oscon2007
PDF
The Essential postgresql.conf
PDF
PostgreSQL Partitioning, PGCon 2007
Advanced Int->Bigint Conversions
Explaining Explain
the-lost-art-of-plpgsql
Managing Chaos In Production: Testing vs Monitoring
Managing Databases In A DevOps Environment 2016
Less Alarming Alerts - SRECon 2016
What Ops Can Learn From Design
Postgres 9.4 First Look
Less Alarming Alerts!
Past, Present, and Pachyderm - All Things Open - 2013
Managing Databases In A DevOps Environment
Advanced WAL File Management With OmniPITR
Scaling with Postgres (Highload++ 2010)
Intro to Postgres 9 Tutorial
Database Scalability Patterns
A Guide To PostgreSQL 9.0
Scaling With Postgres
Intro to pl/PHP Oscon2007
The Essential postgresql.conf
PostgreSQL Partitioning, PGCon 2007
Ad

Recently uploaded (20)

PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mushroom cultivation and it's methods.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
A Presentation on Artificial Intelligence
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPT
Teaching material agriculture food technology
PDF
August Patch Tuesday
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Heart disease approach using modified random forest and particle swarm optimi...
OMC Textile Division Presentation 2021.pptx
Approach and Philosophy of On baking technology
Encapsulation_ Review paper, used for researhc scholars
Mushroom cultivation and it's methods.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Per capita expenditure prediction using model stacking based on satellite ima...
TLE Review Electricity (Electricity).pptx
A Presentation on Artificial Intelligence
Group 1 Presentation -Planning and Decision Making .pptx
Getting Started with Data Integration: FME Form 101
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Teaching material agriculture food technology
August Patch Tuesday
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
cloud_computing_Infrastucture_as_cloud_p
Unlocking AI with Model Context Protocol (MCP)
Assigned Numbers - 2025 - Bluetooth® Document

Check Please!

  • 1. Check Please! What your Postgres database wishes you would monitor / Presentation Friday, May 21, 2010
  • 2. Who am I? • Lead Database Operations at OmniTI • Database Consulting / Management • Postgres? • TB+ OLAP/DSS • multiple 1000+ tps OLTP • custom built, private label • long time user (6.5-9.x) • community member • major contributor Friday, May 21, 2010
  • 3. Check Yourself! • Basic Tuning Is Job #1 • shared buffers, effective cache size, checkpoints • Resources • http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server • http://www.slideshare.net/xzilla/the-essential-postgresqlconf-presentation Friday, May 21, 2010
  • 4. Before You Wreck Yourself! Friday, May 21, 2010
  • 5. Before You Wreck Yourself! • Monitoring • If a server crashes in the woods • Pain is a great motivator Friday, May 21, 2010
  • 6. Before You Wreck Yourself! Friday, May 21, 2010
  • 7. Before You Wreck Yourself! • Trending • Knowing what things look like when they’re good helps determine when things are bad • You can often tell where you’re going by looking at where you came from Friday, May 21, 2010
  • 8. Tools? • Tools cannot replace experience and discipline • But they can help you maintain that discipline • Popular tools • nagios / munin • cacti / mrtg • circonus.com / reconnoiter • { check_postgres } Friday, May 21, 2010
  • 9. Connections • Hard limit on allowed connections • Game Over • Large numbers of concurrent users • Internet facing systems - Paul RJ Muller, beached whale Friday, May 21, 2010
  • 10. Disk Space • Data, clog, xlogs, log files • Game Over • (planning) • Everybody - Squiggle, Overloaded? Friday, May 21, 2010
  • 11. WAL Files • pg_xlog directory, transaction logs • maintain database consistency • excessive disk space • excessive recovery time • heavy write transactions • pg start/stop backup (buggy systems) - Jazzmasterson, Workspace 3.0 - Noguchi File Friday, May 21, 2010
  • 12. Size Matters • more data == more disk space • only grow if you should • large tables, i/o issues • unbounded growth? • fast paced development • everyone else (eventually) - elmada, Size Matters Friday, May 21, 2010
  • 13. Bloating • mvcc leaves dead rows • unused space in tables, indexes • i/o issues • disk space (eventually) • heavy updates, data churn • untuned systems - Joe Alterio, burpalurpa Friday, May 21, 2010
  • 14. Transactions • every statement is in a transaction • select/insert/update/deletes • underlying effects • load spikes • OLTP Systems • Logging/Internet Facing Systems - laurieofindy , Walmart on Black Friday 2009 Friday, May 21, 2010
  • 15. All Stats • pg_stat tables • tables, indexes... scans, tuples • underlying effects • load spikes • OLTP Systems • Logging/Internet Facing Systems - Inju, Statistics for the Utterly Confused Friday, May 21, 2010
  • 16. Free Space Map • Tracks unused space • Keeps vacuum effective • Table / Index Bloat • Medium to Large Systems • High Update / Data Churn DB - SkyTruth, Deepwater Horizon Oil Spill - RADARSAT-2, May 8, 2010 Friday, May 21, 2010
  • 17. Autovacuum Max Freeze Age • Ensures all tables get vacuumed • Prevents XID wrap-around • Heavy I/O • Locking Issues • High TPS / OLTP • pg_dump - Joe Marinaro, Good Morning! Friday, May 21, 2010
  • 18. Long Running Queries • postgres can’t freeze query plans • pg_stat_activity • Can cause issues for vacuum • Uh, response time obligations • active data collection • developers write queries ;-) - _Tawcan, Spiral Out..keep going Friday, May 21, 2010
  • 19. Idle Transactions • BEGIN; zzz... • pg_stat_activity • Can cause issues for vacuum • Connections holding memory • pretty much everyone - psd, Canadian Cashpoints, Bah! Friday, May 21, 2010
  • 20. Sequence limits • sequences limited to 2 billion • non-transactional • Can break inserts • Heavy insert (update?) systems - gavinzac, Rise and Fall in Donegal Friday, May 21, 2010
  • 21. Wrap-around • Postgres must vacuum every table within 2 Billion transactions • Catastrophic data loss • pretty much everyone - Jurvetson, Wrapped Around the Axle Friday, May 21, 2010
  • 22. Settings • postgresql.conf doesn’t always reflect reality • temporary changes can lead to long term trouble • pretty much everyone - denovich, P9220453.jpg Friday, May 21, 2010
  • 23. Thanks! • PGCon • PGCommunity • OmniTI • Want more? • [email protected], http://www.xzilla.net • @robtreat2 • [email protected], http://www.omniti.com/is/hiring Friday, May 21, 2010