Close postgresql connections when the thread pool thread is idle
I think the idle connections associated with idle threads are still taking up memory, so especially now that you can configure an arbitrary number of threads (and thus connections), I think it's good to close them regularly.
This commit is contained in:
parent
aaec813cba
commit
d06230fcf4
3 changed files with 52 additions and 2 deletions
|
|
@ -182,7 +182,13 @@
|
|||
(assoc-ref opts 'show-error-details))
|
||||
|
||||
(%thread-pool-threads
|
||||
(assoc-ref opts 'thread-pool-threads)))
|
||||
(assoc-ref opts 'thread-pool-threads))
|
||||
(%thread-pool-idle-seconds
|
||||
120)
|
||||
(%thread-pool-idle-thunk
|
||||
(lambda ()
|
||||
(close-thread-postgresql-connection))))
|
||||
|
||||
|
||||
(let* ((startup-completed
|
||||
(make-atomic-box
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue