当前位置:网站首页>Pgbench benchmark PostgreSQL
Pgbench benchmark PostgreSQL
2022-07-28 23:05:00 【liuyunshengsir】
pgbench It's a kind of PostgreSQL A simple program to run benchmarks on . It may run the same sequence of... Over and over again in a concurrent database session SQL command , And calculate the average transaction rate ( Transactions per second ). By default ,pgbench Will test a method based on TPC-B But a more relaxed scenario , There are five... Involved in each transaction SELECT、UPDATE as well as INSERT command . however , By writing your own transaction script file, it's easy to test other situations .
1. modify pg_hba.conf
host all all 10.6.8.0/24 trust
systemctl status postgresql-13
2. test
2.1 initialization
[[email protected] data]# /usr/pgsql-13/bin/pgbench -i --unlogged-tables -s 2 -U user001 -p 5432 -d db001 -h 10.6.8.238
dropping old tables...
creating tables...
generating data (client-side)...
200000 of 200000 tuples (100%) done (elapsed 0.07 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 0.57 s (drop tables 0.03 s, create tables 0.03 s, client-side generate 0.24 s, vacuum 0.14 s, primary keys 0.12 s).
2.2 Perform a stress test
-M prepared Represents a call in the form of a bound variable SQL,-r Represents each... In the report test file SQL Average execution delay of ,
-c 8 Indicates simulation 8 A client ,-j 2 Express pgbench The working thread is 2 individual ,
-T 10 Indicates that the time of stress test is 10 second ,-l Indicates that the transaction statistics are written to log, The rest is postgres Connection related parameters
Above parameters , It can also be seen with the help of commands
/usr/pgsql-13/bin/pgbench -M prepared -r -c 8 -j 2 -T 10 -U user001 -h 10.6.8.238 -p 5432 -d db001 -l
Execution results
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 2
query mode: prepared
number of clients: 8
number of threads: 2
duration: 10 s
number of transactions actually processed: 10945
latency average = 7.721 ms
tps = 1036.127306 (including connections establishing)
tps = 1036.693062 (excluding connections establishing)
statement latencies in milliseconds:
0.017 \set aid random(1, 100000 * :scale)
0.015 \set bid random(1, 1 * :scale)
0.014 \set tid random(1, 10 * :scale)
0.013 \set delta random(-5000, 5000)
0.572 BEGIN;
0.640 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
0.649 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
1.214 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
3.341 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
0.636 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
0.411 END;
边栏推荐
- Padim [anomaly detection: embedded based]
- Written questions and answers of software test interview (software test question bank)
- WebApplicationType#deduceFromClasspath
- 从 IPv4 向 IPv6 的迁移
- ValueError: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([
- leetcode101. 对称二叉树
- The simple neural network model based on full connection layer MLP is changed to the model based on CNN convolutional neural network
- Reading of "robust and communication efficient federated learning from non-i.i.d. data"
- Yolov5 improvement 15: network lightweight method deep separable convolution
- Target detection notes - overview and common data sets
猜你喜欢

console.log()控制台显示...解决办法

Improvement 11 of yolov5: replace backbone network C3 with lightweight network mobilenetv3

【图像分割】基于方向谷形检测实现静脉纹路分割附MATLAB代码

Yolov5 improvement 7: loss function improvement

frontiers出版社投稿记录(附状态变化)

Thesis reading (3) - googlenet of classification

cannot resize variables that require grad

Paper reading: deep forest / deep forest /gcforest

【三维目标检测】3DSSD(一)

MySQL foundation - data query
随机推荐
MySQL常用的日期时间函数
console.log()控制台显示...解决办法
Symbol符号类型
递归和迭代
Submission records of frontiers Publishing House (with status changes)
(重要)初识C语言 -- 函数
【物理应用】水下浮动风力涡轮机的尾流诱导动态模拟风场附matlab代码
OSV_ q Expected all tensors to be on the same device, but found at least two devices, cuda:0
NPM run dev, automatically open the browser after running the project
A simple neural network model based on MLP full connection layer
No code development platform management background tutorial
No code development platform address book tutorial
Yolov5 improvement 12: replace backbone network C3 with lightweight network shufflenetv2
Es personal arrangement of relevant interview questions
cnpm安装步骤
OSV_ q The size of tensor a (704) must match the size of tensor b (320) at non-singleton dime
[copy] Internet terms, abbreviations, abbreviations
recursion and iteration
一份来自奎哥的全新MPLS笔记,考IE必看 ----尚文网络奎哥
【雷达】基于核聚类实现雷达信号在线分选附matlab代码