PostgreSQL压力测试
2021/11/29 19:09:43
本文主要是介绍PostgreSQL压力测试,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1 pgbench
pgbench是PostgreSQL自带的压测工具。
1.1 帮助手册
查看帮助手册
点击查看代码
[postgres@guizhou_hp-pop-10-150-57-9 ~]$ pgbench --help pgbench is a benchmarking tool for PostgreSQL. Usage: pgbench [OPTION]... [DBNAME] Initialization options: -i, --initialize invokes initialization mode -F, --fillfactor=NUM set fill factor -n, --no-vacuum do not run VACUUM after initialization -q, --quiet quiet logging (one message each 5 seconds) -s, --scale=NUM scaling factor --foreign-keys create foreign key constraints between tables --index-tablespace=TABLESPACE create indexes in the specified tablespace --tablespace=TABLESPACE create tables in the specified tablespace --unlogged-tables create tables as unlogged tables Options to select what to run: -b, --builtin=NAME[@W] add builtin script NAME weighted at W (default: 1) (use "-b list" to list available scripts) -f, --file=FILENAME[@W] add script FILENAME weighted at W (default: 1) -N, --skip-some-updates skip updates of pgbench_tellers and pgbench_branches (same as "-b simple-update") -S, --select-only perform SELECT-only transactions (same as "-b select-only") Benchmarking options: -c, --client=NUM number of concurrent database clients (default: 1) -C, --connect establish new connection for each transaction -D, --define=VARNAME=VALUE define variable for use by custom script -j, --jobs=NUM number of threads (default: 1) -l, --log write transaction times to log file -L, --latency-limit=NUM count transactions lasting more than NUM ms as late -M, --protocol=simple|extended|prepared protocol for submitting queries (default: simple) -n, --no-vacuum do not run VACUUM before tests -P, --progress=NUM show thread progress report every NUM seconds -r, --report-latencies report average latency per command -R, --rate=NUM target rate in transactions per second -s, --scale=NUM report this scale factor in output -t, --transactions=NUM number of transactions each client runs (default: 10) -T, --time=NUM duration of benchmark test in seconds -v, --vacuum-all vacuum all four standard tables before tests --aggregate-interval=NUM aggregate data over NUM seconds --progress-timestamp use Unix epoch timestamps for progress --sampling-rate=NUM fraction of transactions to log (e.g., 0.01 for 1%) Common options: -d, --debug print debugging output -h, --host=HOSTNAME database server host or socket directory -p, --port=PORT database server port number -U, --username=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>.
这篇关于PostgreSQL压力测试的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-05快速清空 PostgreSQL 数据库中的所有表格,让你的数据库重新焕然一新!
- 2024-01-04在PostgreSQL中创建角色:判断角色是否存在并创建
- 2023-05-16PostgreSQL一站式插件推荐 -- pg_enterprise_views
- 2022-11-22PostgreSQL 实时位置跟踪
- 2022-11-22如何将PostgreSQL插件移植到openGauss
- 2022-11-11PostgreSQL:修改数据库用户的密码
- 2022-11-06Windows 环境搭建 PostgreSQL 物理复制高可用架构数据库服务
- 2022-10-27Windows 环境搭建 PostgreSQL 逻辑复制高可用架构数据库服务
- 2022-10-11PostgreSql安装(Windows10版本)
- 2022-09-13PostgreSQL-Network Address类型操作和函数