Close unused PostgreSQL connections
As they take up memory, so free some by closing them.
This commit is contained in:
parent
9fcd615c1f
commit
6808532338
1 changed files with 10 additions and 2 deletions
|
|
@ -109,7 +109,11 @@
|
|||
(open-postgresql-connection
|
||||
"web"
|
||||
postgresql-statement-timeout))
|
||||
(floor (/ postgresql-connections 2))))
|
||||
(floor (/ postgresql-connections 2))
|
||||
#:idle-seconds 30
|
||||
#:destructor
|
||||
(lambda (conn)
|
||||
(close-postgresql-connection conn "web"))))
|
||||
|
||||
(reserved-connection-pool
|
||||
(make-resource-pool
|
||||
|
|
@ -117,7 +121,11 @@
|
|||
(open-postgresql-connection
|
||||
"web-reserved"
|
||||
postgresql-statement-timeout))
|
||||
(floor (/ postgresql-connections 2))))
|
||||
(floor (/ postgresql-connections 2))
|
||||
#:idle-seconds 600
|
||||
#:destructor
|
||||
(lambda (conn)
|
||||
(close-postgresql-connection conn "web-reserved"))))
|
||||
|
||||
(resource-pool-default-timeout 5))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue