pgbench并发写入测试
最近更新时间: 2025-02-18 16:02:00
[tbase@VM_0_37_centos pgbench]$ cat insert_t_trgm.sql
\set id random(1, 1000000)
insert into t_trgm values(:id,:id,:id) ;
[tbase@VM_0_37_centos pgbench]$ pgbench -h 127.0.0.1 -p 11008 -d postgres -U tbase -c 4 -j 1 -n -M prepared -T 60 -r -f insert_t_trgm.sql > insert_t_trgm.txt 2>&1
[tbase@VM_0_37_centos pgbench]$ tail -20 insert_t_trgm.txt
client 0 receiving
client 2 receiving
client 3 receiving
client 0 receiving
client 1 receiving
pghost: 127.0.0.1 pgport: 11008 nclients: 4 duration: 60 dbName: postgres
transaction type: insert_t_trgm.sql
scaling factor: 1
query mode: prepared
number of clients: 4
number of threads: 1
duration: 60 s
number of transactions actually processed: 57719
latency average = 4.159 ms
tps = 961.874383 (including connections establishing)
tps = 961.961361 (excluding connections establishing)
script statistics:
- statement latencies in milliseconds:
0.011 \set id random(1, 1000000)
4.145 insert into t_trgm values(:id,:id,:id) ;