I built a shell script that just compares the values and displays what is set base on tuning profiles, do not beat me just yet, there is indeed a room for improvement, it is just a 1st shot …
this is the output:
./check_foreman_tuning.sh
Comparing current system tuning parameters with ‘medium’, ‘large’, ‘extra-large’, and ‘extra-extra-large’ profiles…
Tuning Profile Comparison Table:
Parameter |
medium |
large |
extra-large |
extra-extra-large |
Apache ServerLimit |
64 |
64 |
64 |
64 |
Apache MaxRequestWorkers |
1024 |
1024 |
1024 |
1024 |
PostgreSQL max_connections |
1000 |
1000 |
1000 |
1000 |
PostgreSQL shared_buffers |
4GB |
8GB |
16GB |
32GB |
PostgreSQL effective_cache_size |
16GB |
16GB |
32GB |
32GB |
PostgreSQL autovacuum_vacuum_cost_limit |
2000 |
2000 |
2000 |
2000 |
PostgreSQL work_mem |
- |
- |
8MB |
8MB |
Candlepin Java Options |
- |
- |
-Xms1024m -Xmx8192m |
-Xms1024m -Xmx8192m |
Current Apache settings:
/etc/httpd/conf.modules.d/event.conf: ServerLimit 64
/etc/httpd/conf.modules.d/event.conf: MaxRequestWorkers 1024
Current PostgreSQL settings:
max_connections: 1000
shared_buffers: 4GB
effective_cache_size: 16GB
autovacuum_vacuum_cost_limit: 2000
work_mem: 4MB
Current Candlepin Java Options (if running):
And the code, if some one is interested:
#!/bin/bash
echo “Comparing current system tuning parameters with ‘medium’, ‘large’, ‘extra-large’, and ‘extra-extra-large’ profiles…”
echo “”
Display expected values table
echo “Tuning Profile Comparison Table:”
echo “”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “Parameter” “medium” “large” “extra-large” “extra-extra-large”
printf “%s\n” “-----------------------------------------|----------|----------|----------------------|----------------------”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “Apache ServerLimit” “64” “64” “64” “64”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “Apache MaxRequestWorkers” “1024” “1024” “1024” “1024”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “PostgreSQL max_connections” “1000” “1000” “1000” “1000”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “PostgreSQL shared_buffers” “4GB” “8GB” “16GB” “32GB”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “PostgreSQL effective_cache_size” “16GB” “16GB” “32GB” “32GB”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “PostgreSQL autovacuum_vacuum_cost_limit” “2000” “2000” “2000” “2000”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “PostgreSQL work_mem” “-” “-” “8MB” “8MB”
printf “%-40s | %-8s | %-8s | %-20s | %-20s\n” “Candlepin Java Options” “-” “-” “-Xms1024m -Xmx8192m” “-Xms1024m -Xmx8192m”
echo “”
echo “Current Apache settings:”
grep -i ‘ServerLimit|MaxRequestWorkers’ /etc/httpd/conf*/* /etc/httpd/conf.d/* 2>/dev/null
echo “”
echo “Current PostgreSQL settings:”
echo -n " max_connections: "
sudo -u postgres psql -tAc “SHOW max_connections;” 2>/dev/null
echo -n " shared_buffers: "
sudo -u postgres psql -tAc “SHOW shared_buffers;” 2>/dev/null
echo -n " effective_cache_size: "
sudo -u postgres psql -tAc “SHOW effective_cache_size;” 2>/dev/null
echo -n " autovacuum_vacuum_cost_limit: "
sudo -u postgres psql -tAc “SHOW autovacuum_vacuum_cost_limit;” 2>/dev/null
echo -n " work_mem: "
sudo -u postgres psql -tAc “SHOW work_mem;” 2>/dev/null
echo “”
echo “Current Candlepin Java Options (if running):”
ps aux | grep ‘[j]ava’ | grep candlepin
Regards, Jan