PostgreSQL Performance Monitoring Tools

PostgreSQL Performance Monitoring Tools

https://github.com/CloudServer/postgresql-perf-tools

This package includes three useful scripts aimed to help to pinpoint performance issues on systems with PostgreSQL as database backend.

All scritps are written in Python. Requirements:

All scripts require a connect to PostgreSQL database. They take traditional set of DB credentials: host address, port (5432 by default), database name, database user and password.

Note: you may need to modify pg_hba.conf file to allow the scripts to connect to the server. Please refer to official documentaion:http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html

For detailed list of command line options use --help / -h option.

软件包

Python-2.7.tar.bz2   psycopg2-2.6.1.tar.gz   psutil-3.2.2.tar.gz

安装 python2.7

[[email protected] soft_bak]# tar jxvf Python-2.7.tar.bz2

[[email protected] soft_bak]# cd Python-2.7

[[email protected] Python-2.7]# ./configure --prefix=/usr/local/python2.7/

[[email protected] Python-2.7]# make

[[email protected] Python-2.7]# make install

添加/usr/local/python2.7/bin/到Linux的环境变量中

[[email protected] bin]# echo $PATH

/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

[[email protected] bin]# PATH="$PATH":/usr/local/python2.7/bin/

[[email protected] bin]# echo $PATH

/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/python2.7/bin/

删除/usr/bin中的python文件,为python2.7创建连接

[[email protected] bin]# cd /usr/bin/

[[email protected] bin]# rm -rf python

[[email protected] bin]# ln -s /usr/local/python2.7/bin/python ./python

[[email protected] bin]# python

Python 2.7 (r27:82500, Jan 14 2016, 16:13:36)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

解决Python升级后yum不能用的问题

#修改yum文件

vi /usr/bin/yum

将文件头部的

#!/usr/bin/python

改为如下内容

#!/usr/bin/python2.6

安装psutil

[[email protected] soft_bak]# tar zxvf psutil-3.2.2.tar.gz

[[email protected] PGMonitor]# cd psutil-3.2.2

[[email protected] psutil-3.2.2]# python setup.py install

安装psycopg2

[[email protected] soft_bak]# tar zxvf psycopg2-2.6.1.tar.gz

[[email protected] PGMonitor]# cd psycopg2-2.6.1

[[email protected] psycopg2-2.6.1]# python setup.py build_ext --pg-config /usr/local/pg945/bin/pg_config  build

[[email protected] psycopg2-2.6.1]# python setup.py build_ext --pg-config /usr/local/pg945/bin/pg_config  install

安装setuptools

[[email protected] soft_bak]# tar zxvf setuptools-19.2.tar.gz

[[email protected] setuptools-19.2]# cd setuptools-19.2

[[email protected] setuptools-19.2]# python setup.py install

安装postgresql-perf-tools

[[email protected] opt]# git clone https://github.com/CloudServer/postgresql-perf-tools

Initialized empty Git repository in /opt/postgresql-perf-tools/.git/

remote: Counting objects: 22, done.

remote: Total 22 (delta 0), reused 0 (delta 0), pack-reused 22

Unpacking objects: 100% (22/22), done.

[[email protected] opt]# cd postgresql-perf-tools/

启动PostgreSQL

[[email protected] bin]$ ./pg_ctl -D ../data/ start

server starting

生成少量数据

[[email protected] bin]$ ./pgbench -i -F 100 -s 142 -h localhost -p 5432 -U postgres postgres

进程pgbench测试

[[email protected] bin]$ ./pgbench -h localhost -p 5432 -c 10 -T 600

[[email protected] postgresql-perf-tools]# ./pg-top.py  --db-host=localhost

时间: 2024-10-05 04:27:58

PostgreSQL Performance Monitoring Tools的相关文章

Java Performance Optimization Tools and Techniques for Turbocharged Apps--reference

Java Performance Optimization by: Pierre-Hugues Charbonneau reference:http://refcardz.dzone.com/refcardz/java-performance-optimization Java is among the most widely used programming languages in the software development world today. Java applications

【官方博客】StrictMode API for Built-In Performance Monitoring

http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html StrictMode API for Built-In Performance Monitoring [This post is by Brad Fitzpatrick, an Android Software Engineer who worries unreasonably about responsiveness. —Tim

Top 10 Free Wireless Network hacking/monitoring tools for ethical hackers and businesses

There are lots of free tools available online to get easy access to the WiFi networks intended to help the network admins and the programmers working on the WiFi systems and we at Team Techworm have picked the top 10 of those for ethical hackers, pro

Linux Performance Monitoring Commands

Reference [1] http://www.thegeekstuff.com/2011/07/iostat-vmstat-mpstat-examples/?utm_source=feedburner [2] https://www.computerhope.com/unix/iostat.htm [3] https://www.lifewire.com/linux-system-running-uptime-3867758 uptime and w report how long the

System Performance Tunning Tools

最近终于把Brendan Gregg大神的力作<Systems Performance: Enterprise and the Cloud>给看完了,前往系统调优的道路上还有很多路要走,最近打算写一个系列的性能调优的文章,算是一个读书笔记,跟工作上遇到的问题.思路就按照Brendan经常用的性能调优图片来写:

Top 12 Best Free Network Monitoring Tools (12种免费网络监控工具)

1) Fiddler Fiddler(几乎)是适用于任何平台和任何操作系统的最好的免费网络工具,并提供了一些广受欢迎的关键特性.如:性能测试.捕捉记录HTTP/HTTPs请求响应.进行web调试等很多功能. 2) Nagios Nagios是另外一款在互联网上的免费网络监控工具. 它是开源的监控解决方案,它表现非凡并且持续为全球成千上万的组织提供可靠的监测. 3) Nedi Nedi也是一款对用户来说开源的网络监控工具.NeDi可以在你的核心网络设备上,针对CDP, FDP和.或LLDP充分发挥

PostgreSQL相关的软件,库,工具和资源集合

PostgreSQL相关的软件,库,工具和资源集合. 备份 wal-e - Simple Continuous Archiving for Postgres to S3, Azure, or Swift by Heroku Barman - Backup and Recovery Manager for Postgres by 2ndQuadrant GUI pgAdmin - Postgres Administration and Management GUI phpPgAdmin - The

Cheatsheet: 2014 05.01 ~ 05.31

Web Choosing a Web Framework/Language Combo for the Next Decade Optimizing NGINX and PHP-fpm for high traffic sites The Absolute Beginner's Guide to Node.js Node.js Performance Tip of the Week: CPU Profiling Improved JavaScript Intellisense in Visual

Wait statistics, or please tell me where it hurts

https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ By: Paul Randal Posted on: December 9, 2010 3:18 pm (Check out my Pluralsight online training course: SQL Server: Performance Troubleshooting Using Wait Statistics