Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

postgres: pgtune configs for m5a/t3a types and pgbench testing on separate machine #29

Merged
merged 4 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions postgresql/postgres.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
{
"t3a.nano" = {
max_connections = 40;
shared_buffers = "128MB";
work_mem = "655kB";
maintenance_work_mem = "32MB";
max_worker_processes = 2;
max_parallel_workers_per_gather = 1;
max_parallel_workers = 2;
max_parallel_maintenance_workers = 1;

effective_cache_size = "384MB";
default_statistics_target = 100;
effective_io_concurrency = 200;

wal_level = "minimal";
archive_mode = "off";
max_wal_senders = 0;
wal_buffers = "3932kB";
min_wal_size = "2GB";
max_wal_size = "8GB";
random_page_cost = 1.1;
checkpoint_completion_target = 0.9;
};
"t3a.micro" = {
max_connections = 60;
shared_buffers = "256MB";
Expand Down Expand Up @@ -43,6 +66,58 @@
max_wal_size = "4GB";
min_wal_size = "1GB";
};
"t3a.xlarge" = {
max_connections = 200;
shared_buffers = "4GB";
effective_cache_size = "12GB";
maintenance_work_mem = "1GB";
checkpoint_completion_target = 0.9;
wal_buffers = "16MB";
random_page_cost = 1.1;
effective_io_concurrency = 200;
work_mem = "10485kB";
max_worker_processes = 4;
max_parallel_workers_per_gather = 2;
max_parallel_workers = 4;
max_parallel_maintenance_workers = 2;
};
"t3a.2xlarge" = {
max_connections = 200;
shared_buffers = "8GB";
effective_cache_size = "24GB";
maintenance_work_mem = "2GB";
checkpoint_completion_target = 0.9;
wal_buffers = "16MB";
random_page_cost = 1.1;
effective_io_concurrency = 200;
work_mem = "10485kB";
max_worker_processes = 8;
max_parallel_workers_per_gather = 4;
max_parallel_workers = 8;
max_parallel_maintenance_workers = 4;
};
"m5a.large" = {
max_connections = 200;
shared_buffers = "2GB";
work_mem = "10485kB";
maintenance_work_mem = "512MB";
max_worker_processes = 2;
max_parallel_maintenance_workers = 1;
max_parallel_workers_per_gather = 1;
max_parallel_workers = 2;

effective_cache_size = "6GB";
default_statistics_target = 100;
effective_io_concurrency = 200;

wal_level = "minimal";
archive_mode = "off";
max_wal_senders = 0;
wal_compression = "on";
wal_buffers = "16MB";
min_wal_size = "1GB";
max_wal_size = "4GB";
};
"m5a.xlarge" = {
max_connections = 240;
shared_buffers = "4GB";
Expand Down Expand Up @@ -101,6 +176,72 @@
default_statistics_target = 100;
effective_io_concurrency = 200;

wal_level = "minimal";
archive_mode = "off";
max_wal_senders = 0;
wal_compression = "on";
wal_buffers = "16MB";
max_wal_size = "4GB";
min_wal_size = "2GB";
};
"m5a.8xlarge" = {
max_connections = 600;
shared_buffers = "32GB";
work_mem = "27962kB";
maintenance_work_mem = "2GB";
max_worker_processes = 32;
max_parallel_maintenance_workers = 4;
max_parallel_workers_per_gather = 4;
max_parallel_workers = 32;

effective_cache_size = "96GB";
default_statistics_target = 100;
effective_io_concurrency = 200;

wal_level = "minimal";
archive_mode = "off";
max_wal_senders = 0;
wal_compression = "on";
wal_buffers = "16MB";
min_wal_size = "2GB";
max_wal_size = "8GB";
};
"m5a.12xlarge" = {
max_connections = 800;
shared_buffers = "48GB";
work_mem = "41943kB";
maintenance_work_mem = "2GB";
max_worker_processes = 48;
max_parallel_maintenance_workers = 4;
max_parallel_workers_per_gather = 4;
max_parallel_workers = 48;

effective_cache_size = "144GB";
default_statistics_target = 100;
effective_io_concurrency = 200;

wal_level = "minimal";
archive_mode = "off";
max_wal_senders = 0;
wal_compression = "on";
wal_buffers = "16MB";
max_wal_size = "4GB";
min_wal_size = "2GB";
};
"m5a.16xlarge" = {
max_connections = 1000;
shared_buffers = "64GB";
work_mem = "83886kB";
maintenance_work_mem = "2GB";
max_worker_processes = 64;
max_parallel_maintenance_workers = 4;
max_parallel_workers_per_gather = 4;
max_parallel_workers = 64;

effective_cache_size = "192GB";
default_statistics_target = 100;
effective_io_concurrency = 200;

wal_level = "minimal";
archive_mode = "off";
max_wal_senders = 0;
Expand Down
211 changes: 211 additions & 0 deletions postgrest/PGBENCH_RESULTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
<!--pgrbench-all-pg-instances repeat 3 pgrbench-pgbench -c 100 > PGBENCH_RESULTS.md -->

Running on a m5a.large
Comment on lines +1 to +3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uploaded the results obtained by this command:

pgrbench-all-pg-instances repeat 3 pgrbench-pgbench -c 100 > PGBENCH_RESULTS.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



Run 1:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 45492
latency average = 66.235 ms
tps = 1509.766608 (including connections establishing)
tps = 1510.166881 (excluding connections establishing)

Run 2:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 50828
latency average = 59.331 ms
tps = 1685.471195 (including connections establishing)
tps = 1686.528635 (excluding connections establishing)

Run 3:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 53997
latency average = 55.817 ms
tps = 1791.559195 (including connections establishing)
tps = 1792.247708 (excluding connections establishing)

Running on a m5a.xlarge


Run 1:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 92804
latency average = 32.448 ms
tps = 3081.890468 (including connections establishing)
tps = 3082.342735 (excluding connections establishing)

Run 2:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 114382
latency average = 26.316 ms
tps = 3799.897694 (including connections establishing)
tps = 3800.595158 (excluding connections establishing)

Run 3:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 115656
latency average = 26.068 ms
tps = 3836.188151 (including connections establishing)
tps = 3836.812069 (excluding connections establishing)

Running on a m5a.2xlarge


Run 1:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 142970
latency average = 21.036 ms
tps = 4753.743995 (including connections establishing)
tps = 4754.249103 (excluding connections establishing)

Run 2:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 233928
latency average = 12.860 ms
tps = 7775.855491 (including connections establishing)
tps = 7776.714704 (excluding connections establishing)

Run 3:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 235969
latency average = 12.761 ms
tps = 7836.620631 (including connections establishing)
tps = 7837.585665 (excluding connections establishing)

Running on a m5a.4xlarge


Run 1:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 171468
latency average = 17.536 ms
tps = 5702.618662 (including connections establishing)
tps = 5703.228351 (excluding connections establishing)

Run 2:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 351608
latency average = 8.555 ms
tps = 11688.693390 (including connections establishing)
tps = 11690.031243 (excluding connections establishing)

Run 3:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 355595
latency average = 8.454 ms
tps = 11828.751758 (including connections establishing)
tps = 11830.103914 (excluding connections establishing)

Running on a m5a.8xlarge


Run 1:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 176047
latency average = 17.082 ms
tps = 5854.134383 (including connections establishing)
tps = 5854.820377 (excluding connections establishing)

Run 2:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 372931
latency average = 8.062 ms
tps = 12403.998820 (including connections establishing)
tps = 12405.350491 (excluding connections establishing)

Run 3:

transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: prepared
number of clients: 100
number of threads: 8
duration: 30 s
number of transactions actually processed: 377333
latency average = 7.968 ms
tps = 12550.028498 (including connections establishing)
tps = 12551.435376 (excluding connections establishing)
Loading