make connection pool
This commit is contained in:
@ -91,7 +91,7 @@ WSGI_APPLICATION = 'config.wsgi.application'
|
|||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.contrib.gis.db.backends.postgis',
|
'ENGINE': 'dj_db_conn_pool.backends.postgresql',
|
||||||
'NAME': env("POSTGRES_DBNAME"),
|
'NAME': env("POSTGRES_DBNAME"),
|
||||||
'USER': env("POSTGRES_USER"),
|
'USER': env("POSTGRES_USER"),
|
||||||
'PASSWORD': env("POSTGRES_PASS"),
|
'PASSWORD': env("POSTGRES_PASS"),
|
||||||
@ -100,6 +100,15 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'POOL_OPTIONS' : {
|
||||||
|
'POOL_SIZE': 200,
|
||||||
|
'MAX_OVERFLOW': 10,
|
||||||
|
'RECYCLE': 24 * 60 * 60
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
|
||||||
|
|||||||
@ -61,7 +61,7 @@ external_pid_file = '/var/run/postgresql/12-main.pid' # write an extra PID fil
|
|||||||
# defaults to 'localhost'; use '*' for all
|
# defaults to 'localhost'; use '*' for all
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
port = 5432 # (change requires restart)
|
port = 5432 # (change requires restart)
|
||||||
max_connections = 600 # (change requires restart)
|
max_connections = 100 # (change requires restart)
|
||||||
#superuser_reserved_connections = 3 # (change requires restart)
|
#superuser_reserved_connections = 3 # (change requires restart)
|
||||||
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
|
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
|
|||||||
@ -64,3 +64,4 @@ urllib3==1.26.7
|
|||||||
django-extra-fields==3.0.2
|
django-extra-fields==3.0.2
|
||||||
django-phonenumber-field==6.1.0
|
django-phonenumber-field==6.1.0
|
||||||
django-rest-knox==4.2.0
|
django-rest-knox==4.2.0
|
||||||
|
django-db-connection-pool[postgresql]
|
||||||
|
|||||||
Reference in New Issue
Block a user