Postgres pgbenchを実行してみる

ショコラ
ショコラ

Postgres pgbenchを実行してみる

8スレッド、16GB~32GBのハードを想定のテストです。

もっさん先輩
もっさん先輩

ドッカーのインストール後に実行すること

Ubuntu版

# ドッカーにユーザーを追加する
usermod -aG docker ubuntu
# 一度再起動した方がいいかも
shutdown -r now

# ドッカーコンポーズインストール
curl -L "https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# ドッカーコンポーズに実行権限を与える
chmod +x /usr/local/bin/docker-compose
# ドッカーコンポーズ確認
docker-compose --version

# ドッカーを開始
systemctl start docker
# ドッカーを確認
systemctl status docker

# hello-world で確認
docker run --rm hello-world
# apache で確認
docker run -p 80:80 -d php:apache

AlmaLinux8版

dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install docker-ce docker-ce-cli containerd.io --skip-broken
dnf erase docker-ce docker-ce-cli containerd.io

dnf -y install podman-docker
pip3 install podman-compose

# ドッカーにユーザーを追加する
usermod -aG docker ubuntu
# 一度再起動した方がいいかも
shutdown -r now

# ドッカーコンポーズインストール
curl -L "https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# ドッカーコンポーズに実行権限を与える
chmod +x /usr/local/bin/docker-compose
# ドッカーコンポーズ確認
docker-compose --version

# ドッカーを開始
systemctl start docker
# ドッカーを確認
systemctl status docker

# hello-world で確認
docker run --rm hello-world
# apache で確認
docker run -p 80:80 -d php:apache

docker-compose.yml を用意します。

16GBのDBサーバーの設定

version: '3'
services:
  test-db:
    shm_size: 8g
    cap_add:
      -  SYS_PTRACE
    security_opt:
      - seccomp:unconfined
    image: postgres:latest
    ports:
      - "5432:5432"
    command:
      - "postgres"
      - "-c"
      - "listen_addresses=*"
      - "-c"
      - "shared_buffers=4GB"
      - "-c"
      - "effective_cache_size=8GB"
      - "-c"
      - "max_connections=512"
      - "-c"
      - "work_mem=24MB"
      - "-c"
      - "random_page_cost=1.1"
    environment:
      POSTGRES_PASSWORD: 123456
      POSTGRES_HOST_AUTH_METHOD: password

↓これで初期化する

su - postgres
createdb pgbench_db

Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz

IOPSを3000&スループットを125 → IOPSを12000&スループットを312 に変更

スケールファクタは1000の1億

pgbench -i -s 1000 pgbench_db
$ pgbench -i -s 1000 pgbench_db
dropping old tables...
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
creating tables...
generating data (client-side)...
100000000 of 100000000 tuples (100%) done (elapsed 84.65 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 114.72 s (drop tables 0.00 s, create tables 0.00 s, client-side generate 84.98 s, vacuum 0.16 s, primary keys 29.58 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.3 (Debian 16.3-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 573658
number of failed transactions: 0 (0.000%)
latency average = 42.022 ms
initial connection time = 171.703 ms
tps = 9518.774224 (without initial connection time)

スケールファクタは400の4000万

pgbench -i -s 400 pgbench_db
$ pgbench -i -s 400 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
40000000 of 40000000 tuples (100%) done (elapsed 32.83 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 46.05 s (drop tables 1.59 s, create tables 0.01 s, client-side generate 32.98 s, vacuum 0.14 s, primary keys 11.33 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.3 (Debian 16.3-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 400
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 604004
number of failed transactions: 0 (0.000%)
latency average = 39.901 ms
initial connection time = 167.629 ms
tps = 10024.689452 (without initial connection time)

スケールファクタは200の2000

pgbench -i -s 200 pgbench_db
$ pgbench -i -s 200 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
20000000 of 20000000 tuples (100%) done (elapsed 16.28 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 23.57 s (drop tables 0.75 s, create tables 0.01 s, client-side generate 16.36 s, vacuum 0.14 s, primary keys 6.33 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.3 (Debian 16.3-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 200
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 627798
number of failed transactions: 0 (0.000%)
latency average = 38.396 ms
initial connection time = 174.315 ms
tps = 10417.786082 (without initial connection time)

Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz

スケールファクタは1000の1億

pgbench -i -s 1000 pgbench_db
$ pgbench -i -s 1000 pgbench_db
dropping old tables...
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
creating tables...
generating data (client-side)...
100000000 of 100000000 tuples (100%) done (elapsed 111.45 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 157.94 s (drop tables 0.00 s, create tables 0.00 s, client-side generate 111.90 s, vacuum 0.33 s, primary keys 45.71 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.3 (Debian 16.3-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 390545
number of failed transactions: 0 (0.000%)
latency average = 61.884 ms
initial connection time = 163.634 ms
tps = 6463.691414 (without initial connection time)

スケールファクタは400の4000万

pgbench -i -s 400 pgbench_db
~$ pgbench -i -s 400 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
40000000 of 40000000 tuples (100%) done (elapsed 44.03 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 60.67 s (drop tables 0.76 s, create tables 0.01 s, client-side generate 44.21 s, vacuum 0.18 s, primary keys 15.51 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.3 (Debian 16.3-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 400
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 416702
number of failed transactions: 0 (0.000%)
latency average = 57.998 ms
initial connection time = 159.278 ms
tps = 6896.733782 (without initial connection time)

スケールファクタは200の2000万

pgbench -i -s 200 pgbench_db
$ pgbench -i -s 200 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
20000000 of 20000000 tuples (100%) done (elapsed 20.93 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 29.92 s (drop tables 0.60 s, create tables 0.00 s, client-side generate 21.05 s, vacuum 0.17 s, primary keys 8.09 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.3 (Debian 16.3-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 200
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 453781
number of failed transactions: 0 (0.000%)
latency average = 53.232 ms
initial connection time = 186.209 ms
tps = 7514.273578 (without initial connection time)

Intel Xeon Processor (Icelake) メモリ16GB/CPU8Core

スケールファクタは1000の1億

pgbench -i -s 1000 pgbench_db
$ pgbench -i -s 1000 pgbench_db
dropping old tables...
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
creating tables...
generating data (client-side)...
100000000 of 100000000 tuples (100%) done (elapsed 81.79 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 107.53 s (drop tables 0.00 s, create tables 0.00 s, client-side generate 82.22 s, vacuum 0.61 s, primary keys 24.69 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 485238
number of failed transactions: 0 (0.000%)
latency average = 49.659 ms
initial connection time = 156.678 ms
tps = 8054.978058 (without initial connection time)

スケールファクタは400の4000万

pgbench -i -s 400 pgbench_db
$ pgbench -i -s 400 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
40000000 of 40000000 tuples (100%) done (elapsed 30.20 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 41.16 s (drop tables 0.92 s, create tables 0.01 s, client-side generate 30.36 s, vacuum 0.16 s, primary keys 9.71 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 400
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 544278
number of failed transactions: 0 (0.000%)
latency average = 44.268 ms
initial connection time = 137.350 ms
tps = 9035.877403 (without initial connection time)

スケールファクタは200の2000万

pgbench -i -s 200 pgbench_db
$ pgbench -i -s 200 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
20000000 of 20000000 tuples (100%) done (elapsed 14.37 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 20.45 s (drop tables 0.74 s, create tables 0.01 s, client-side generate 14.47 s, vacuum 0.16 s, primary keys 5.07 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 200
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 584651
number of failed transactions: 0 (0.000%)
latency average = 41.210 ms
initial connection time = 154.264 ms
tps = 9706.427917 (without initial connection time)

Intel Xeon Processor (Icelake) メモリ32GB/CPU12Core

スケールファクタは1000の1億

pgbench -i -s 1000 pgbench_db
$ pgbench -i -s 1000 pgbench_db
dropping old tables...
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
creating tables...
generating data (client-side)...
100000000 of 100000000 tuples (100%) done (elapsed 99.92 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 131.70 s (drop tables 0.00 s, create tables 0.01 s, client-side generate 100.35 s, vacuum 0.22 s, primary keys 31.12 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 527447
number of failed transactions: 0 (0.000%)
latency average = 45.641 ms
initial connection time = 177.040 ms
tps = 8764.138599 (without initial connection time)

スケールファクタは400の4000万

pgbench -i -s 400 pgbench_db
$ pgbench -i -s 400 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
40000000 of 40000000 tuples (100%) done (elapsed 39.30 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 53.86 s (drop tables 1.70 s, create tables 0.01 s, client-side generate 39.51 s, vacuum 0.20 s, primary keys 12.44 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 400
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 594490
number of failed transactions: 0 (0.000%)
latency average = 40.476 ms
initial connection time = 172.007 ms
tps = 9882.373671 (without initial connection time)

スケールファクタは200の2000万

pgbench -i -s 200 pgbench_db
$ pgbench -i -s 200 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
20000000 of 20000000 tuples (100%) done (elapsed 18.82 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 26.02 s (drop tables 0.91 s, create tables 0.01 s, client-side generate 18.95 s, vacuum 0.17 s, primary keys 5.98 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 200
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 598851
number of failed transactions: 0 (0.000%)
latency average = 40.169 ms
initial connection time = 151.132 ms
tps = 9958.010970 (without initial connection time)

Intel Xeon Processor (Icelake) メモリ64GB/CPU24Core

スケールファクタは1000の1億

pgbench -i -s 1000 pgbench_db
$ pgbench -i -s 1000 pgbench_db
dropping old tables...
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
creating tables...
generating data (client-side)...
100000000 of 100000000 tuples (100%) done (elapsed 99.06 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 131.41 s (drop tables 0.00 s, create tables 0.01 s, client-side generate 99.49 s, vacuum 0.22 s, primary keys 31.69 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 530388
number of failed transactions: 0 (0.000%)
latency average = 45.363 ms
initial connection time = 174.681 ms
tps = 8817.680261 (without initial connection time)

スケールファクタは400の4000万

pgbench -i -s 400 pgbench_db
$ pgbench -i -s 400 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
40000000 of 40000000 tuples (100%) done (elapsed 38.71 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 52.98 s (drop tables 1.78 s, create tables 0.01 s, client-side generate 38.90 s, vacuum 0.19 s, primary keys 12.11 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 400
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 574368
number of failed transactions: 0 (0.000%)
latency average = 41.804 ms
initial connection time = 169.150 ms
tps = 9568.426751 (without initial connection time)

スケールファクタは200の2000万

pgbench -i -s 200 pgbench_db
$ pgbench -i -s 200 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
20000000 of 20000000 tuples (100%) done (elapsed 18.68 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 25.77 s (drop tables 0.86 s, create tables 0.01 s, client-side generate 18.77 s, vacuum 0.18 s, primary keys 5.96 s).

ベンチ

pgbench -c 400 -j 16 -T 60 pgbench_db
$ pgbench -c 400 -j 16 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 200
query mode: simple
number of clients: 400
number of threads: 16
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 581203
number of failed transactions: 0 (0.000%)
latency average = 41.343 ms
initial connection time = 149.022 ms
tps = 9675.217509 (without initial connection time)

Intel Xeon Processor (Icelake) メモリ64GB/CPU24Core 24スレッド

スケールファクタは1000の1億

pgbench -i -s 1000 pgbench_db
$ pgbench -i -s 1000 pgbench_db
dropping old tables...
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
creating tables...
generating data (client-side)...
100000000 of 100000000 tuples (100%) done (elapsed 99.06 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 131.41 s (drop tables 0.00 s, create tables 0.01 s, client-side generate 99.49 s, vacuum 0.22 s, primary keys 31.69 s).

ベンチ(24スレッド)

pgbench -c 400 -j 24 -T 60 pgbench_db
$ pgbench -c 400 -j 24 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: simple
number of clients: 400
number of threads: 24
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 568694
number of failed transactions: 0 (0.000%)
latency average = 42.238 ms
initial connection time = 182.745 ms
tps = 9470.185885 (without initial connection time)

スケールファクタは400の4000万

pgbench -i -s 400 pgbench_db
$ pgbench -i -s 400 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
40000000 of 40000000 tuples (100%) done (elapsed 38.71 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 52.98 s (drop tables 1.78 s, create tables 0.01 s, client-side generate 38.90 s, vacuum 0.19 s, primary keys 12.11 s).

ベンチ(24スレッド)

pgbench -c 400 -j 24 -T 60 pgbench_db
$ pgbench -c 400 -j 24 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 400
query mode: simple
number of clients: 400
number of threads: 24
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 616739
number of failed transactions: 0 (0.000%)
latency average = 38.964 ms
initial connection time = 149.570 ms
tps = 10265.849206 (without initial connection time)

スケールファクタは200の2000万

pgbench -i -s 200 pgbench_db
$ pgbench -i -s 200 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
20000000 of 20000000 tuples (100%) done (elapsed 18.82 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 26.02 s (drop tables 0.91 s, create tables 0.01 s, client-side generate 18.95 s, vacuum 0.17 s, primary keys 5.98 s).

ベンチ(24スレッド)

pgbench -c 400 -j 24 -T 60 pgbench_db
$ pgbench -c 400 -j 24 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 200
query mode: simple
number of clients: 400
number of threads: 24
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 667131
number of failed transactions: 0 (0.000%)
latency average = 36.026 ms
initial connection time = 142.733 ms
tps = 11103.086763 (without initial connection time)

Intel(R) Xeon(R) E-2334 CPU @ 3.40GHz

スケールファクタは1000の1億

pgbench -i -s 1000 pgbench_db
$ pgbench -i -s 1000 pgbench_db
dropping old tables...
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
creating tables...
generating data (client-side)...
100000000 of 100000000 tuples (100%) done (elapsed 45.80 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 69.39 s (drop tables 0.00 s, create tables 0.00 s, client-side generate 46.02 s, vacuum 0.20 s, primary keys 23.16 s).

ベンチ

pgbench -c 400 -j 24 -T 60 pgbench_db
$ pgbench -c 400 -j 24 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: simple
number of clients: 400
number of threads: 24
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 658119
number of failed transactions: 0 (0.000%)
latency average = 36.798 ms
initial connection time = 127.618 ms
tps = 10870.179041 (without initial connection time)

スケールファクタは400の4000万

pgbench -i -s 400 pgbench_db
$ pgbench -i -s 400 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
40000000 of 40000000 tuples (100%) done (elapsed 18.42 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 26.48 s (drop tables 0.55 s, create tables 0.00 s, client-side generate 18.51 s, vacuum 0.12 s, primary keys 7.29 s).

ベンチ

pgbench -c 400 -j 24 -T 60 pgbench_db
$ pgbench -c 400 -j 24 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 400
query mode: simple
number of clients: 400
number of threads: 24
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 713210
number of failed transactions: 0 (0.000%)
latency average = 33.919 ms
initial connection time = 125.768 ms
tps = 11792.941276 (without initial connection time)

スケールファクタは200の2000万

pgbench -i -s 200 pgbench_db
$ pgbench -i -s 200 pgbench_db
dropping old tables...
creating tables...
generating data (client-side)...
20000000 of 20000000 tuples (100%) done (elapsed 9.44 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done in 13.67 s (drop tables 0.39 s, create tables 0.00 s, client-side generate 9.50 s, vacuum 0.12 s, primary keys 3.66 s).

ベンチ

pgbench -c 400 -j 24 -T 60 pgbench_db
$ pgbench -c 400 -j 24 -T 60 pgbench_db
pgbench (16.4 (Debian 16.4-1.pgdg120+1))
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 200
query mode: simple
number of clients: 400
number of threads: 24
maximum number of tries: 1
duration: 60 s
number of transactions actually processed: 734407
number of failed transactions: 0 (0.000%)
latency average = 32.933 ms
initial connection time = 131.224 ms
tps = 12146.020836 (without initial connection time)
Scroll to Top