PostgreSQL 性能测试工具
2015-11-18 16:49
369 查看
postgresql 自带性能测试工具 pgbench
pgbench 是 postgresql 自带的交互性能测试工具。用于测试postgresql数据库性能。
为了测试postgresql数据库性能,简单测试如下
测试数据库初始化
生成8千万数据的测试库
生成20亿测试数据(海量数据生成,生成速度看机器配置)
单独安装,postgresql94-contrib
pgbench 是 postgresql 自带的交互性能测试工具。用于测试postgresql数据库性能。
为了测试postgresql数据库性能,简单测试如下
bash-4.2$ pgbench --help pgbench is a benchmarking tool for PostgreSQL. Usage: pgbench [OPTION]... [DBNAME] Initialization options: -i invokes initialization mode -F NUM fill factor -s NUM scaling factor --index-tablespace=TABLESPACE create indexes in the specified tablespace --tablespace=TABLESPACE create tables in the specified tablespace --unlogged-tables create tables as unlogged tables Benchmarking options: -c NUM number of concurrent database clients (default: 1) -C establish new connection for each transaction -D VARNAME=VALUE define variable for use by custom script -f FILENAME read transaction script from FILENAME -j NUM number of threads (default: 1) -l write transaction times to log file -M simple|extended|prepared protocol for submitting queries to server (default: simple) -n do not run VACUUM before tests -N do not update tables "pgbench_tellers" and "pgbench_branches" -r report average latency per command -s NUM report this scale factor in output -S perform SELECT-only transactions -t NUM number of transactions each client runs (default: 10) -T NUM duration of benchmark test in seconds -v vacuum all four standard tables before tests Common options: -d print debugging output -h HOSTNAME database server host or socket directory -p PORT database server port number -U USERNAME connect as specified database user -V, --version output version information, then exit -?, --help show this help, then exit Report bugs to <pgsql-bugs@postgresql.org>.
测试数据库初始化
pgbench -i pgbench
生成8千万数据的测试库
pgbench -i -s 800 pgbench
生成20亿测试数据(海量数据生成,生成速度看机器配置)
pgbench -i-s 20000 pgbench
单独安装,postgresql94-contrib
yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
yum install postgresql94-contrib
相关文章推荐
- mysql 区间锁
- MySQL的information_schema的介绍
- Sql Server常用功能
- sqoop连接mysql的一些错误
- 数据库字符串截取——Demo(100;30;20)
- mysql添加索引
- Redis:下载、安装,简单使用
- Redis Sentinel:集群Failover解决方案
- Java调用Oracle存储过程
- 数据库基础语句,聚合函数,练习
- mysql 存储过程权限相关
- oracle sqlplus 登陆用法
- Java中使用Jedis操作Redis
- SQL Server ->> SET ANSI_PADDING对于字符串插入的影响
- 将远程oracle数据库导入到本地数据库
- ORACLE spool
- 【转】MySQL中varchar最大长度是多少?
- 阿里云Ubuntu 14.04.2 memcached安装后客户端连接时提示no route to host
- Navicat for MySQL 快捷键
- 5 个免费的受欢迎的 SQLite 管理工具