Skip to content

Commit

Permalink
Merge pull request #231 from norcalipa/norcalipa/increase-cpu-use-thr…
Browse files Browse the repository at this point in the history
…eading

Updating settings for multithreading
  • Loading branch information
norcalipa authored Nov 12, 2024
2 parents 8752f7a + 222d78c commit 1d72ead
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions crank/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
'HOST': os.environ.get('DB_HOST'),
'PORT': os.environ.get('DB_PORT'),
'USER': os.environ.get('DB_USER'),
'PASSWORD': os.environ.get('DB_PASS')
# 'OPTIONS': {'ssl': {'ca': os.environ.get('MYSQL_ATTR_SSL_CA')}}
'PASSWORD': os.environ.get('DB_PASS'),
'CONN_MAX_AGE': 0, # Use 0 for connection pooling
'OPTIONS': {
'MAX_CONNS': 8, # Maximum number of connections in the pool
'REUSE_CONNS': 4, # Number of connections to reuse
},
}
}
ALLOWED_HOSTS = ['*']
Expand Down
8 changes: 5 additions & 3 deletions k8s/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ spec:
failureThreshold: 3
resources:
requests:
memory: "160Mi"
cpu: "250m"
memory: "256Mi"
cpu: "1"
limits:
memory: "512Mi"
cpu: "1"
cpu: "2"
ports:
- name: http
containerPort: 8080
Expand All @@ -87,6 +87,8 @@ spec:
value: "prod"
- name: PYTHONUNBUFFERED
value: "1"
- name: PYTHON_GIL
value: "0"
envFrom:
- secretRef:
name: db-connect-credentials
Expand Down

0 comments on commit 1d72ead

Please sign in to comment.