In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to implement pgbench stress test script, the article is very detailed, has a certain reference value, interested friends must read!
Create a test table and fill it with data 5000W pen records.
pgbench -i -F 100 -s 500 -h 127.0.0.1 -U user
Pressure test 300 seconds.
pgbench -c 128 -j 1024 -M prepared -n -s 500 -T 300 -f ./ rw.sql -h 127.0.0.1 -p 5432 -U user
cat rw.sql
\set nbranches :scale
\set ntellers 10 * :scale
\set naccounts 100000 * :scale
\set aid random( 1 ,:naccounts )
\set bid random(1 ,:nbranches )
\set tid random( 1, :ntellers )
\set delta random(-5000, 5000 )
BEGIN;
UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CLOCK_TIMESTAMP());
END;
Results of multiple tests:
Tps is around 19000.
After the database cold start, direct pressure test results:
tps : around 16000.
The above is "pgbench how to implement stress test script" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.