SlideShare uma empresa Scribd logo
1 de 6
Baixar para ler offline
Copyright 2015 Uptime Technologies, LLC. All rights reserved. 1
A “Victorinox” for PostgreSQL DBA
Postgres Toolkit
Satoshi Nagayasu
@snaga
pgcon2015
2015/6/18
What is “Postgres Toolkit”?
• A collection of scripts and utilities to manage
PostgreSQL servers
• Allows DBA to perform complicated tasks with single
commands
• Focusing on frequent tasks for PostgreSQL DBA to
improve their productivity and quality of operations
• Distributed under the open source license (GPLv2)
Copyright 2015 Uptime Technologies, LLC. All rights reserved. 2
Postgres Toolkit 0.2.1
• Released on May 2015
– Consists of 13 scripts
• Supported Platforms and Versions
– Red Hat Enterprise Linux 6 / CentOS 6
– Red Hat Enterprise Linux 7 / CentOS 7
– Ubuntu 14.04 LTS
– PostgreSQL 9.0〜9.4
• Source code
– https://github.com/uptimejp/postgres-toolkit
• Documentation
– http://postgres-toolkit.readthedocs.org/
Copyright 2015 Uptime Technologies, LLC. All rights reserved. 3
Installation
Copyright 2015 Uptime Technologies, LLC. All rights reserved. 4
[root@devvm04 ~]# curl ‐L http://dl.uptimeforce.com/postgres‐toolkit/install.sh | sh
% Total    % Received % Xferd Average Speed   Time    Time Time Current
Dload Upload   Total   Spent    Left  Speed
140   280  140   280    0     0    550      0 ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ 5833
% Total    % Received % Xferd Average Speed   Time    Time Time Current
Dload Upload   Total   Spent    Left  Speed
100  275k  100  275k    0     0   307k      0 ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ 486k
opt/uptime/postgres‐toolkit‐0.2/
opt/uptime/postgres‐toolkit‐0.2/bin/
opt/uptime/postgres‐toolkit‐0.2/bin/pt‐config
opt/uptime/postgres‐toolkit‐0.2/bin/pt‐snap‐statements
opt/uptime/postgres‐toolkit‐0.2/bin/pt‐proc‐stat
(...snip...)
opt/uptime/postgres‐toolkit‐0.2/lib/DirectoryTree.pyc
opt/uptime/postgres‐toolkit‐0.2/lib/TcpdumpWrapper.py
opt/uptime/postgres‐toolkit‐0.2/LICENSE
[root@devvm04 ~]# ls /opt/uptime/postgres‐toolkit‐0.2/
LICENSE  bin  docs  lib  share  src
[root@devvm04 ~]# ls /opt/uptime/postgres‐toolkit‐0.2/bin/
pt‐config pt‐replication‐stat  pt‐stat‐snapshot     pt‐xact‐stat
pt‐index‐usage  pt‐session‐profiler  pt‐table‐usage       verifychecksum.bin
pt‐kill         pt‐set‐tablespace pt‐tablespace‐usage
pt‐proc‐stat    pt‐snap‐statements   pt‐verify‐checksum
[root@devvm04 ~]#
http://postgres-toolkit.readthedocs.org/en/latest/install.html#id2
Command list
Command Description
pt-config
Show and set parameters in postgresql.conf, the PostgreSQL configuration file, without using
editor (like emacs or vi.)
pt-index-usage
Show index usage, including index size, tuple/block access statistics, timestamp of
vacuum/analyze, and tablespace name at once.
pt-kill Send signal to a backend to cancel a running query or to terminate the backend safely.
pt-proc-stat
Show status and process statistics, including disk I/O and network I/O, of each process in the
PostgreSQL instance.
pt-replication-stat
Show status and statistics of master and slave node(s) at once, which a replication cluster
consists of.
pt-session-profiler
Show queries, which exceeded specified elapsed time, by capturing network traffice and
analyze it.
pt-set-tablespace Change tablespace for multiple tables and releted indexes at once.
pt-snap-statements Show statistics of queries which ran in the specified period of time.
pt-stat-snapshot Take snapshots of several statistics which can be obtained in PostgreSQL, and manage them.
pt-table-usage
Show table usage, including table size, tuple/block access statistics, timestamp of
vacuum/analyze, and tablespace name at once.
pt-tablespace-usage
Summarize tablespace usage per database, and show them with available space size of the
partition.
pt-verify-checksum
Verify checksums of table and index files in a database cluster at once. (Supported 9.3 or
later)
pt-xact-stat
Show several statistics of multiple PostgreSQL instances at once, including number of
sessions and number of transactions (commit and rollbacks)
Copyright 2015 Uptime Technologies, LLC. All rights reserved. 5
pt-session-profiler
• Uses tcpdump internally.
• Extracts the FE/BE wire-protocol on the fly.
• Prints queries which exceed specific threshold.
• You donʼt need to change or touch your production
PostgreSQL.
Copyright 2015 Uptime Technologies, LLC. All rights reserved. 6

Mais conteúdo relacionado

Mais procurados

PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuning
elliando dias
 
Planning for-high-performance-web-application
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-application
Nguyễn Duy Nhân
 
Introduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System AdministratorsIntroduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System Administrators
Jignesh Shah
 
Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with Kubernetes
Jonathan Katz
 

Mais procurados (20)

PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuning
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper look
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easy
 
Streaming replication in practice
Streaming replication in practiceStreaming replication in practice
Streaming replication in practice
 
Как PostgreSQL работает с диском
Как PostgreSQL работает с дискомКак PostgreSQL работает с диском
Как PostgreSQL работает с диском
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
 
pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ...
pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ...pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ...
pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ...
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Planning for-high-performance-web-application
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-application
 
Introduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System AdministratorsIntroduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System Administrators
 
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataProblems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
PostgreSQL Replication with Bucardo
PostgreSQL Replication with BucardoPostgreSQL Replication with Bucardo
PostgreSQL Replication with Bucardo
 
Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우
 
Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with Kubernetes
 
GitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons LearnedGitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons Learned
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
PostgreSQL on Solaris
PostgreSQL on SolarisPostgreSQL on Solaris
PostgreSQL on Solaris
 

Destaque (8)

PL/Pythonで独自の集約関数を作ってみる
PL/Pythonで独自の集約関数を作ってみるPL/Pythonで独自の集約関数を作ってみる
PL/Pythonで独自の集約関数を作ってみる
 
Postgres Toolkitのご紹介
Postgres Toolkitのご紹介Postgres Toolkitのご紹介
Postgres Toolkitのご紹介
 
OSC沖縄2014_JPUG資料
OSC沖縄2014_JPUG資料OSC沖縄2014_JPUG資料
OSC沖縄2014_JPUG資料
 
20140531 JPUGしくみ+アプリケーション分科会 勉強会資料
20140531 JPUGしくみ+アプリケーション分科会 勉強会資料20140531 JPUGしくみ+アプリケーション分科会 勉強会資料
20140531 JPUGしくみ+アプリケーション分科会 勉強会資料
 
明日から使えるPostgre sql運用管理テクニック(監視編)
明日から使えるPostgre sql運用管理テクニック(監視編)明日から使えるPostgre sql運用管理テクニック(監視編)
明日から使えるPostgre sql運用管理テクニック(監視編)
 
Postgre sql9.3 newlockmode_and_etc
Postgre sql9.3 newlockmode_and_etcPostgre sql9.3 newlockmode_and_etc
Postgre sql9.3 newlockmode_and_etc
 
PostgreSQLセキュリティ総復習
PostgreSQLセキュリティ総復習PostgreSQLセキュリティ総復習
PostgreSQLセキュリティ総復習
 
PostgreSQLアーキテクチャ入門(PostgreSQL Conference 2012)
PostgreSQLアーキテクチャ入門(PostgreSQL Conference 2012)PostgreSQLアーキテクチャ入門(PostgreSQL Conference 2012)
PostgreSQLアーキテクチャ入門(PostgreSQL Conference 2012)
 

Semelhante a Postgres Toolkit

Semelhante a Postgres Toolkit (20)

Real World Storage in Treasure Data
Real World Storage in Treasure DataReal World Storage in Treasure Data
Real World Storage in Treasure Data
 
Prestogres internals
Prestogres internalsPrestogres internals
Prestogres internals
 
Logstash
LogstashLogstash
Logstash
 
Presto
PrestoPresto
Presto
 
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 ...
 
ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)
 
Airflow at lyft
Airflow at lyftAirflow at lyft
Airflow at lyft
 
How to integrate_custom_openstack_services_with_devstack
How to integrate_custom_openstack_services_with_devstackHow to integrate_custom_openstack_services_with_devstack
How to integrate_custom_openstack_services_with_devstack
 
Large Scale Crawling with Apache Nutch and Friends
Large Scale Crawling with Apache Nutch and FriendsLarge Scale Crawling with Apache Nutch and Friends
Large Scale Crawling with Apache Nutch and Friends
 
Large Scale Crawling with Apache Nutch and Friends
Large Scale Crawling with Apache Nutch and FriendsLarge Scale Crawling with Apache Nutch and Friends
Large Scale Crawling with Apache Nutch and Friends
 
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and CassandraReal-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
 
Sanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticiansSanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticians
 
Flexible compute
Flexible computeFlexible compute
Flexible compute
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Neo4j 4.1 overview
Neo4j 4.1 overviewNeo4j 4.1 overview
Neo4j 4.1 overview
 
Percona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA'sPercona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA's
 
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
 
Introduction to Openstack Network
Introduction to Openstack NetworkIntroduction to Openstack Network
Introduction to Openstack Network
 
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
 
Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin  Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin
 

Mais de Uptime Technologies LLC (JP)

Uptime Database Appliance テクノロジープレビュー
Uptime Database Appliance テクノロジープレビューUptime Database Appliance テクノロジープレビュー
Uptime Database Appliance テクノロジープレビュー
Uptime Technologies LLC (JP)
 
5ステップで始めるPostgreSQLレプリケーション@hbstudy#13
5ステップで始めるPostgreSQLレプリケーション@hbstudy#135ステップで始めるPostgreSQLレプリケーション@hbstudy#13
5ステップで始めるPostgreSQLレプリケーション@hbstudy#13
Uptime Technologies LLC (JP)
 

Mais de Uptime Technologies LLC (JP) (11)

pgstattuple2: デッドタプル推定のための統計的手法
pgstattuple2: デッドタプル推定のための統計的手法pgstattuple2: デッドタプル推定のための統計的手法
pgstattuple2: デッドタプル推定のための統計的手法
 
「今そこにある危機」を捉える ~ pg_stat_statements revisited
「今そこにある危機」を捉える ~ pg_stat_statements revisited「今そこにある危機」を捉える ~ pg_stat_statements revisited
「今そこにある危機」を捉える ~ pg_stat_statements revisited
 
PostgreSQLバックアップの基本
PostgreSQLバックアップの基本PostgreSQLバックアップの基本
PostgreSQLバックアップの基本
 
BigDataを迎え撃つ! PostgreSQL並列分散ミドルウェア「Stado」の紹介と検証報告
BigDataを迎え撃つ! PostgreSQL並列分散ミドルウェア「Stado」の紹介と検証報告BigDataを迎え撃つ! PostgreSQL並列分散ミドルウェア「Stado」の紹介と検証報告
BigDataを迎え撃つ! PostgreSQL並列分散ミドルウェア「Stado」の紹介と検証報告
 
いまさら聞けないPostgreSQL運用管理
いまさら聞けないPostgreSQL運用管理いまさら聞けないPostgreSQL運用管理
いまさら聞けないPostgreSQL運用管理
 
PostgreSQLアーキテクチャ入門(INSIGHT OUT 2011)
PostgreSQLアーキテクチャ入門(INSIGHT OUT 2011)PostgreSQLアーキテクチャ入門(INSIGHT OUT 2011)
PostgreSQLアーキテクチャ入門(INSIGHT OUT 2011)
 
PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"
 
PostgreSQLアーキテクチャ入門
PostgreSQLアーキテクチャ入門PostgreSQLアーキテクチャ入門
PostgreSQLアーキテクチャ入門
 
Uptime Database Appliance テクノロジープレビュー
Uptime Database Appliance テクノロジープレビューUptime Database Appliance テクノロジープレビュー
Uptime Database Appliance テクノロジープレビュー
 
5ステップで始めるPostgreSQLレプリケーション@hbstudy#13
5ステップで始めるPostgreSQLレプリケーション@hbstudy#135ステップで始めるPostgreSQLレプリケーション@hbstudy#13
5ステップで始めるPostgreSQLレプリケーション@hbstudy#13
 
PostgreSQL安定運用のコツ2009 @hbstudy#5
PostgreSQL安定運用のコツ2009 @hbstudy#5PostgreSQL安定運用のコツ2009 @hbstudy#5
PostgreSQL安定運用のコツ2009 @hbstudy#5
 

Último

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Postgres Toolkit

  • 1. Copyright 2015 Uptime Technologies, LLC. All rights reserved. 1 A “Victorinox” for PostgreSQL DBA Postgres Toolkit Satoshi Nagayasu @snaga pgcon2015 2015/6/18
  • 2. What is “Postgres Toolkit”? • A collection of scripts and utilities to manage PostgreSQL servers • Allows DBA to perform complicated tasks with single commands • Focusing on frequent tasks for PostgreSQL DBA to improve their productivity and quality of operations • Distributed under the open source license (GPLv2) Copyright 2015 Uptime Technologies, LLC. All rights reserved. 2
  • 3. Postgres Toolkit 0.2.1 • Released on May 2015 – Consists of 13 scripts • Supported Platforms and Versions – Red Hat Enterprise Linux 6 / CentOS 6 – Red Hat Enterprise Linux 7 / CentOS 7 – Ubuntu 14.04 LTS – PostgreSQL 9.0〜9.4 • Source code – https://github.com/uptimejp/postgres-toolkit • Documentation – http://postgres-toolkit.readthedocs.org/ Copyright 2015 Uptime Technologies, LLC. All rights reserved. 3
  • 4. Installation Copyright 2015 Uptime Technologies, LLC. All rights reserved. 4 [root@devvm04 ~]# curl ‐L http://dl.uptimeforce.com/postgres‐toolkit/install.sh | sh % Total    % Received % Xferd Average Speed   Time    Time Time Current Dload Upload   Total   Spent    Left  Speed 140   280  140   280    0     0    550      0 ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ 5833 % Total    % Received % Xferd Average Speed   Time    Time Time Current Dload Upload   Total   Spent    Left  Speed 100  275k  100  275k    0     0   307k      0 ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ ‐‐:‐‐:‐‐ 486k opt/uptime/postgres‐toolkit‐0.2/ opt/uptime/postgres‐toolkit‐0.2/bin/ opt/uptime/postgres‐toolkit‐0.2/bin/pt‐config opt/uptime/postgres‐toolkit‐0.2/bin/pt‐snap‐statements opt/uptime/postgres‐toolkit‐0.2/bin/pt‐proc‐stat (...snip...) opt/uptime/postgres‐toolkit‐0.2/lib/DirectoryTree.pyc opt/uptime/postgres‐toolkit‐0.2/lib/TcpdumpWrapper.py opt/uptime/postgres‐toolkit‐0.2/LICENSE [root@devvm04 ~]# ls /opt/uptime/postgres‐toolkit‐0.2/ LICENSE  bin  docs  lib  share  src [root@devvm04 ~]# ls /opt/uptime/postgres‐toolkit‐0.2/bin/ pt‐config pt‐replication‐stat  pt‐stat‐snapshot     pt‐xact‐stat pt‐index‐usage  pt‐session‐profiler  pt‐table‐usage       verifychecksum.bin pt‐kill         pt‐set‐tablespace pt‐tablespace‐usage pt‐proc‐stat    pt‐snap‐statements   pt‐verify‐checksum [root@devvm04 ~]# http://postgres-toolkit.readthedocs.org/en/latest/install.html#id2
  • 5. Command list Command Description pt-config Show and set parameters in postgresql.conf, the PostgreSQL configuration file, without using editor (like emacs or vi.) pt-index-usage Show index usage, including index size, tuple/block access statistics, timestamp of vacuum/analyze, and tablespace name at once. pt-kill Send signal to a backend to cancel a running query or to terminate the backend safely. pt-proc-stat Show status and process statistics, including disk I/O and network I/O, of each process in the PostgreSQL instance. pt-replication-stat Show status and statistics of master and slave node(s) at once, which a replication cluster consists of. pt-session-profiler Show queries, which exceeded specified elapsed time, by capturing network traffice and analyze it. pt-set-tablespace Change tablespace for multiple tables and releted indexes at once. pt-snap-statements Show statistics of queries which ran in the specified period of time. pt-stat-snapshot Take snapshots of several statistics which can be obtained in PostgreSQL, and manage them. pt-table-usage Show table usage, including table size, tuple/block access statistics, timestamp of vacuum/analyze, and tablespace name at once. pt-tablespace-usage Summarize tablespace usage per database, and show them with available space size of the partition. pt-verify-checksum Verify checksums of table and index files in a database cluster at once. (Supported 9.3 or later) pt-xact-stat Show several statistics of multiple PostgreSQL instances at once, including number of sessions and number of transactions (commit and rollbacks) Copyright 2015 Uptime Technologies, LLC. All rights reserved. 5
  • 6. pt-session-profiler • Uses tcpdump internally. • Extracts the FE/BE wire-protocol on the fly. • Prints queries which exceed specific threshold. • You donʼt need to change or touch your production PostgreSQL. Copyright 2015 Uptime Technologies, LLC. All rights reserved. 6