Skip to content

Commit

Permalink
refactoring in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
esgn committed Mar 18, 2024
1 parent 47d10c6 commit 70a3f00
Show file tree
Hide file tree
Showing 21 changed files with 487 additions and 319 deletions.
742 changes: 453 additions & 289 deletions pgtune.sh

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/expected_results/10_linux_web_8GB_8_1000_hdd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
2 changes: 1 addition & 1 deletion test/expected_results/10_linux_web_8GB_8_1000_san.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
2 changes: 1 addition & 1 deletion test/expected_results/10_linux_web_8GB_8_1000_ssd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
2 changes: 1 addition & 1 deletion test/expected_results/11_linux_web_8GB_8_1000_hdd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/11_linux_web_8GB_8_1000_san.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/11_linux_web_8GB_8_1000_ssd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/12_linux_web_8GB_8_1000_hdd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/12_linux_web_8GB_8_1000_san.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/12_linux_web_8GB_8_1000_ssd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/13_linux_web_8GB_8_1000_hdd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/13_linux_web_8GB_8_1000_san.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/13_linux_web_8GB_8_1000_ssd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/14_linux_web_8GB_8_1000_hdd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/14_linux_web_8GB_8_1000_san.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/14_linux_web_8GB_8_1000_ssd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/15_linux_web_8GB_8_1000_hdd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/15_linux_web_8GB_8_1000_san.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
2 changes: 1 addition & 1 deletion test/expected_results/15_linux_web_8GB_8_1000_ssd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ work_mem = 524kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_parallel_maintenance_workers = 4
max_parallel_workers_per_gather = 4
26 changes: 15 additions & 11 deletions test/scripts/pull_testing_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
# This script pulls images from Docker Hub and run them
# to do a simple check of PostgreSQL configuration

set -e

testing_image="esgn/pgtuned-testing"

tags=$(curl "https://registry.hub.docker.com/v2/repositories/$testing_image/tags?page_size=32" 2>/dev/null | jq -r '.results | .[] | .name')
for tag in $tags
do
image_name=$testing_image":"$tag
docker rmi $image_name &> /dev/null
docker pull -q $image_name
docker run -d -e POSTGRES_PASSWORD=secret --name pg-testing$tag $image_name
docker exec -ti pg-testing$tag bash -c "until pg_isready -q; do sleep 5; done"
docker exec -ti pg-testing$tag bash -c "cat /etc/apt/sources.list.d/pgdg.list"
docker exec -ti pg-testing$tag bash -c "cat /var/lib/postgresql/data/postgresql.conf" > pg-testing$tag".txt"
docker stop pg-testing$tag &> /dev/null && docker rm pg-testing$tag &> /dev/null
# get all available tags from docker hub registry
tags=$(curl "https://registry.hub.docker.com/v2/repositories/$testing_image/tags?page_size=100" 2>/dev/null | jq -r '.results | .[] | .name')

# Iterate over tags
for tag in $tags; do
image_name=$testing_image":"$tag
docker rmi --force $image_name &>/dev/null
docker pull -q $image_name
docker run -d -e POSTGRES_PASSWORD=secret --name pg-testing$tag $image_name
docker exec -ti pg-testing$tag bash -c "until pg_isready -q; do sleep 5; done"
# docker exec -ti pg-testing$tag bash -c "cat /etc/apt/sources.list.d/pgdg.list"
docker exec -ti pg-testing$tag bash -c "cat /var/lib/postgresql/data/postgresql.conf" >pg-testing$tag".txt"
docker stop pg-testing$tag &>/dev/null && docker rm --force pg-testing$tag &>/dev/null
done
2 changes: 1 addition & 1 deletion test/scripts/test_pgtune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
test_files_dir="../expected_results/"
pgtuned_script="../../pgtune.sh"
pg_versions="16 15 14 13 12 11 10 9.6 9.5"
db_types="web oltp dw desktop mixed"
# db_types="web oltp dw desktop mixed"
total_mem=8GB
cpu_count=8
max_conn=1000
Expand Down

0 comments on commit 70a3f00

Please sign in to comment.