Commit 54b6fc18 authored by Laurent Peuch's avatar Laurent Peuch

[doc] document connections pooler

parent 7f2e4c3518de
.. -*- coding: utf-8 -*-
.. _connection_poller:
Source connections pooler
=========================
*CubicWeb* comes with a connections pool for it's datasource (typically sqlite
or postgresql), it is a dynamic pool meaning that:
* it will keep a minimum number of connections open (by default 0)
* when load increase it will open new connections
* if a max number of connections is set it will stop once it's reached
* if the max number of connections is zero, it is considered to be unlimited
* after some idle time (`connections-pool-idle-timeout`), if no new connections needed to be open
on a new request, the pool will close one unused connection if the queue isn't empty
* if no connection are available after some time and the max number of connections has been
reached, the connections pool will raise. To fix this, you can either increase the value of
`connections-pool-max-size` or set it to 0 for an unlimited number of connections. A minimum of
5 connections per process is recommended if you want to set a max number.
Note that the connections pool won't be activated in some "quick start" situations
like database dump/restore.
Configuration
-------------
The values used by the connections pool are fully configurable *in your instance
configuration file* (usually the `all-in-one.conf`), here is the list:
* **connections-pooler-enabled**: enable the connections pooler, default: true. You want to disable
the pool if you are using another external pooling system like pgbouncer.
* **connections-pool-max-size**: max size of the connections pool. 0 means unlimited. Each source
supporting multiple connections will have this maximum number of opened connections, default: 0
* **min-connections-pool-size**: min size of the connections pool. Each source
supporting multiple connections will have this minimum number of opened
connections, default: 0
* **connections-pool-idle-timeout**: the delay, in seconds, after the last opened connection before
which the pool will start closing unused connections. A connection is only closed on a request
that didn't need to create a new connection, default: 600
......@@ -24,3 +24,4 @@ separate layer and has its own whole chapter.
fti.rst
dataimport
debug_channels
connections_pooler
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment