Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jovuit
funkwhale
Commits
28b334ad
Verified
Commit
28b334ad
authored
Oct 17, 2019
by
Eliot Berriot
Browse files
Reduce DB connection leaks
parent
bd3a4b44
Changes
4
Hide whitespace changes
Inline
Side-by-side
api/compose/django/server.sh
View file @
28b334ad
#!/bin/bash -eux
python /app/manage.py collectstatic
--noinput
gunicorn config.asgi:application
-w
${
FUNKWHALE_WEB_WORKERS
-1
}
-k
uvicorn.workers.UvicornWorker
-b
0.0.0.0:5000
gunicorn config.asgi:application
-w
${
FUNKWHALE_WEB_WORKERS
-1
}
-k
uvicorn.workers.UvicornWorker
-b
0.0.0.0:5000
${
GUNICORN_ARGS
-
}
api/config/asgi.py
View file @
28b334ad
import
os
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"config.settings.production"
)
os
.
environ
.
setdefault
(
"ASGI_THREADS"
,
"5"
)
import
django
# noqa
...
...
api/config/settings/common.py
View file @
28b334ad
...
...
@@ -270,7 +270,7 @@ DATABASES = {
"default"
:
env
.
db
(
"DATABASE_URL"
)
}
DATABASES
[
"default"
][
"ATOMIC_REQUESTS"
]
=
True
DATABASES
[
"default"
][
"CONN_MAX_AGE"
]
=
env
(
"DB_CONN_MAX_AGE"
,
default
=
60
*
60
)
DATABASES
[
"default"
][
"CONN_MAX_AGE"
]
=
env
(
"DB_CONN_MAX_AGE"
,
default
=
60
*
5
)
MIGRATION_MODULES
=
{
# see https://github.com/jazzband/django-oauth-toolkit/issues/634
...
...
changes/changelog.d/db.enhancement
0 → 100644
View file @
28b334ad
Reduce the number of simultaneous DB connections under some deployment scenario
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment