PostgreSQL 性能测试工具

PostgreSQL 性能测试工具,第1张

概述postgresql 自带性能测试工具 pgbench pgbench 是 postgresql 自带的交互性能测试工具。用于测试postgresql数据库性能。 为了测试postgresql数据库性能,简单测试如下 bash-4.2$ pgbench --helppgbench is a benchmarking tool for PostgreSQL.Usage: pgbench [ @H_419_0@

postgresql 自带性能测试工具 pgbench
pgbench 是 postgresql 自带的交互性能测试工具。用于测试postgresql数据库性能。
为了测试postgresql数据库性能,简单测试如下

bash-4.2$ pgbench --helppgbench 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 tablesBenchmarking 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
总结

以上是内存溢出为你收集整理的PostgreSQL 性能测试工具全部内容,希望文章能够帮你解决PostgreSQL 性能测试工具所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1175084.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存