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 |