Upload
rjuju
View
346
Download
4
Tags:
Embed Size (px)
Citation preview
Keep an eye on yourPostgreSQL clusters
Open PostgreSQL Monitoring & PostgreSQLWorkload Analyzer
Julien Rouhaud
Dalibo - www.dalibo.org
pgconf.ru 2015 - February, 6th
[ 1 / 37 ]
Monitoring?
I Service availabilityI Service, host, network...I Alerting
I Service performanceI GraphingI TrendingI Analysis
I At what cost ?I Open source projects
[ 2 / 37 ]
What already exists
I Different kind of toolsI Command line tools / datasourcesI Generic solutions with probesI Dedicated solutions
[ 3 / 37 ]
Command lineAnd data sources
I Nice featuresI But more useful for emergency situationsI Or need some external tool for best usage
[ 4 / 37 ]
Command lineSome examples
I command lineI pg_viewI pg_activityI pgstats
I Data sourceI all pg_stat* catalogI pg_stat_statements, pg_stat_plansI pg_proctab
[ 5 / 37 ]
Probe
I Gather informations for another toolI Can sometimes be used in standaloneI Some examples
I check_postgresI pg_monz
[ 6 / 37 ]
Dedicated solution
I Complete for its purposeI More pertinentI But not numerous
[ 7 / 37 ]
OPM and PoWA?
I OPMI aim to be a dedicated solutionI relies on existing or new probes and components
I PoWAI Dedicated performance solution
[ 8 / 37 ]
EcosystemGeneric solution based on probes
Name Native graphing AlertingNagios No YesZabbix Yes YesMunin Yes YesCacti Yes No
[ 9 / 37 ]
General Overview
I ProsI Robust and matureI AdaptableI Extendable
I ConsI UI not flexibleI Data not available for queryingI Except check_postgres, lack of really completedatasource
[ 10 / 37 ]
NagiosSpecific
I Graphing (with third part tool like OPM V2)I PostgreSQL compatibility with
I check_postgres (Bucardo)I check_pg_activity (OPM)
I Hard to configure
[ 11 / 37 ]
ZabbixOverview
I PostgreSQL compatibility withI pg_monz (only PG 9.2+)I postbix (no news since 2013)
[ 12 / 37 ]
MuninOverview
I Native PostgreSQL compatibility, and withI pyMunin
[ 13 / 37 ]
CactiOverview
I PostgreSQL compatibility withI Some workaround with check_postgres (MRTGformat)
[ 14 / 37 ]
What about OPM
I And for Open PostgreSQL Monitoring ?
[ 15 / 37 ]
OPMArchitecture
I NagiosI SchedulerI Alerting
I ProbesI PG specific : check_pgactivityI And monitoring-plugin
I StorageI PostgreSQL :)I 9.3 or more
I GUII Dedicated GUI
[ 16 / 37 ]
OPMOverview
[ 17 / 37 ]
check_pgactivityDesign
I Written from scratch, simpler codeI Provide lots of servicesI Handle a small cacheI Better perfdata
[ 18 / 37 ]
check_pgactivityNew features
I Handle multi-database connections transparentlyI Can compute delta instead of raw valuesI Handle units
[ 19 / 37 ]
check_pgactivityNew service examples
I bgwriter statisticsI better bloat estimationI Most important settings check
[ 20 / 37 ]
check_pgactivityEnhanced service
I better bloat estimationI replication : pg_stat_replication or hot standbyI "Instant" hit ratio
[ 21 / 37 ]
User interface
I Specific ACLI More modern graphsI Custom graph display, tags. . .
[ 22 / 37 ]
EcosystemSpecific solution
Name Maintained Aim Alertingpg_statsinfo Yes Generalist Possiblepg_watch Dead? Generalist NopgObserver Yes Performance NopgCluu Yes Generalist NoPoWA Yes Performance No
[ 23 / 37 ]
pg_statsinfoPros & cons
I ProsI Useful metrics
I ConsI Reports on demandI Needs specific C extension (reboot required) oneach monitored server
[ 24 / 37 ]
pgObserverPros & cons
I ProsI Useful metricsI And novel metrics (like stored proc)I Dynamic reports
I ButI Focused on performance
[ 25 / 37 ]
pgCluuPros & cons
I ProsI Useful metricsI General overviewI Easy to use
I ConsI Can be storage greedyI Need to generate reports
[ 26 / 37 ]
PoWA 2.0
I A complete solutionI Focused on performance
I Handle a lot of datasourceI Requires PG 9.4 or more
I requires queryid exposure, sincepg_stat_statements 1.2
[ 27 / 37 ]
What is PoWA
I PostgreSQL extension : powa-archivistI A background workerI Dedicated snapshot, aggregation and purgefunctions
I Dedicated UI : powa-web
[ 28 / 37 ]
PoWAExtensions handled
I Existing extensionsI pg_stat_statementsI pg_proctab (WIP)
I New oneI pg_qualstatsI pg_stat_kcacheI pg_track_settings (WIP)
[ 29 / 37 ]
pg_qualstatsPresentation
I Gather real-time statistics on where clauses perquery
I SeqScan / indexScanI OperatorI Number of executionI Filter ratioI . . .
[ 30 / 37 ]
pg_qualstatsWhat it allows
I Find missing indexesI Which could be partialI Or on several columns if some other queries couldbenefit from it
I . . .
[ 31 / 37 ]
pg_qualstatsWhat it allows
I EXPLAIN normalized queries with real valuesI Most frequentsI Most/Least filteringI . . .
[ 32 / 37 ]
pg_stat_kcachePresentation
I Gather real-time per query system statistics
[ 33 / 37 ]
pg_stat_kcacheWhat it allows
I Compute a real hit ratio (shared_buffers, systemcache and disk)
I Show CPU consumptionI global, per database and/or per query and/or peruser
I over time
[ 34 / 37 ]
Demo
I demo-powa.dalibo.com powa // demoI demo.opm.io opm // demo
[ 35 / 37 ]
For the future
I Nagios optional from OPMI Add ability to handle PoWA in OPMI Better use of metrics
I Trending / statistic analysisI Correlate informations
I Better index suggestion, global database analysisI And much more. . .
[ 36 / 37 ]
Questions?
I [email protected] [email protected] [email protected]
I github.com/OPMDG - github.com/dalibo/powaI Thank you !
[ 37 / 37 ]