Skip to content

Commit

Permalink
Set share memory size for airflow psql service
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlu committed Nov 29, 2024
1 parent 1673d43 commit 8391f20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cloud/google/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def GenerateEnvironVar(context, hostname_manager):
'POSTGRES_USER': postgres_user,
'POSTGRES_PASSWORD': postgres_password,
'POSTGRES_DB': postgres_db,
'POSTGRES_SHM_MB': """$(free -m|grep Mem|awk '{print int($2/16)}')""",
'POSTGRES_MEM_MB': """$(free -m|grep Mem|awk '{print int($2/4)}')""",
'POSTGRES_MAX_CONN': """$(free -m|grep Mem|awk '{print int($2/32)}')""",
'GRAFANA_USERNAME': grafana_username,
Expand Down
1 change: 1 addition & 0 deletions deploy/docker-compose-CeleryExecutor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ services:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
shm_size: "${POSTGRES_SHM_MB}m"
volumes:
- postgres-storage:/var/lib/postgresql/data
command: -c max_connections=${POSTGRES_MAX_CONN} -c shared_buffers=${POSTGRES_MEM_MB}MB -c idle_in_transaction_session_timeout=300000
Expand Down

0 comments on commit 8391f20

Please sign in to comment.