пятница, 10 июля 2020 г.

Сравнение

sudo time /usr/lib/postgresql/11/bin/pgbench -U postgres -i -s 1000 pgbench

sudo su postgres
psql
postgres=# CREATE DATABASE pgbench;

time /usr/lib/postgresql/11/bin/pgbench  -i -s 1000 pgbench

100000000 of 100000000 tuples (100%) done (elapsed 583.27 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done.

real    18m12,278s
user    2m19,308s
sys     0m3,557s


postgres@u2004:/home/user$ time pgbench -j 32 -c 32 -M prepared -T 600 pgbench
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: prepared
number of clients: 32
number of threads: 32
duration: 600 s
number of transactions actually processed: 1056430
latency average = 18.178 ms
tps = 1760.353143 (including connections establishing)
tps = 1760.467637 (excluding connections establishing)

real    10m0,289s
user    1m34,845s
sys     3m13,124s
postgres@u2004:/home/user$




sudo su -c "cp /etc/postgresql/11/main/postgresql.conf /root/postgresql.conf.bak"
sudo pg_dropcluster --stop 11 main
sudo pg_createcluster --locale ru_RU.UTF-8 11 main
sudo su -c "cp /root/postgresql.conf.bak /etc/postgresql/11/main/postgresql.conf"
sudo nano /etc/postgresql/11/main/postgresql.conf
sudo nano /etc/postgresql/11/main/postgresql.conf
sudo pg_ctlcluster 11 main start 
sudo -u postgres psql -U postgres -c "alter user postgres with password 'pass';"
sudo su postgres
psql
postgres=# CREATE DATABASE pgbench;
time /usr/lib/postgresql/11/bin/pgbench -i -s 1000 pgbench

100000000 of 100000000 tuples (100%) done (elapsed 518.15 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done.

real    13m26,553s
user    2m11,722s
sys     0m2,846s


time pgbench -j 32 -c 32 -M prepared -T 600 pgbench

:/home/user$ time pgbench -j 32 -c 32 -M prepared -T 600 pgbench
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: prepared
number of clients: 32
number of threads: 32
duration: 600 s
number of transactions actually processed: 1425678
latency average = 13.469 ms
tps = 2375.790120 (including connections establishing)
tps = 2376.012756 (excluding connections establishing)

real    10m0,334s
user    1m59,212s
sys     3m48,208s





100000000 of 100000000 tuples (100%) done (elapsed 583.27 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done.

real    18m12,278s
user    2m19,308s
sys     0m3,557s

100000000 of 100000000 tuples (100%) done (elapsed 583.27 s, remaining 0.00 s)
100000000 of 100000000 tuples (100%) done (elapsed 518.15 s, remaining 0.00 s)
583/518=1.125


:/home/user$ time pgbench -j 32 -c 32 -M prepared -T 600 pgbench
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: prepared
number of clients: 32
number of threads: 32
duration: 600 s
number of transactions actually processed: 1425678
latency average = 13.469 ms
tps = 2375.790120 (including connections establishing)
tps = 2376.012756 (excluding connections establishing)

real    10m0,334s
user    1m59,212s
sys     3m48,208s


postgres@u2004:/home/user$ time pgbench -j 32 -c 32 -M prepared -T 600 pgbench
starting vacuum...end.
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 1000
query mode: prepared
number of clients: 32
number of threads: 32
duration: 600 s
number of transactions actually processed: 1056430
latency average = 18.178 ms
tps = 1760.353143 (including connections establishing)
tps = 1760.467637 (excluding connections establishing)

real    10m0,289s
user    1m34,845s
sys     3m13,124s
postgres@u2004:/home/user$




 

Комментариев нет:

Отправить комментарий