postgres压测工具pgbench

1简介

PG数据库提供了一款轻量级的压力测试工具叫pgbench, 测试模型是TPC-B.

2安装

3.参数介绍

[postgres@localhost  bin]$ 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(填充因子-对表的填充因子,类似oracle的pctfree作用)

-n, --no-vacuum          do not run VACUUM after initialization(初始化完成后不VACUUM)

-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(创建表为unlogged表)

Benchmarking options:

-c, --client=NUM           number of concurrent database clients (default: 1) 客户端个数(默认: 1)

-C, --connect              establish new connection for each transaction为每一个事务建立一个新的连接

-D, --define=VARNAME=VALUE   define variable for use by custom script通过客户脚本为用户定义变量

-f, --file=FILENAME         read transaction script from FILENAME指定测试脚本的位置,不指定为自带的默认脚本

-j, --jobs=NUM           number of threads (default: 1) 启动线程数(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) 向服务器提交查询的协议 (default: simple)

-n, --no-vacuum        

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值