ထုတ်လုပ်မှုပတ်ဝန်းကျင်များအတွက် optimization ဖြင့် Ubuntu 22.04 တွင် PostgreSQL database ကို install လုပ်ပါ။
Ubuntu 22.04 ပေါ်တွင် PostgreSQL ဒေတာဘေ့စဆာဗာကို ထုတ်လုပ်မှုအသုံးပြုမှုအတွက် အသင့်တော်ဆုံး configuration နှင့်အတူ တည်ဆောက်ပါ။
sudo apt update
sudo apt install postgresql postgresql-contrib -y
/etc/postgresql/14/main/postgresql.conf တည်းဖြတ်ခြင်းအားဖြင့် PostgreSQL ကို configurate:
max_connections = 200
shared_buffers = 256MB
effective_cache_size = 1GB
work_mem = 4MB
sudo -u postgres psql
CREATE DATABASE myapp;
CREATE USER myuser WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE myapp TO myuser;
Tune shared_buffers သို့ 25% RAM ကို၏။ မြင့်မားသော-traffic applications များများအတွက်ဆက်သွယ်မှုစုဆောင်း (pgBouncer) ကိုအသုံးပြုပါ။
ရုပ်ပိုင်းဆိုင်ရာ backups များအတွက်လက္ခဏာ backups သို့မဟုတ် pg_basebackup အတွက် pg_dump ကိုအသုံးပြုပါ။ streaming replication ကို setting up လုပ်ဖို့စဉ်းစားပါ။