Skip to content
Commit 289c775d authored by P. Christeas's avatar P. Christeas Committed by Daniel Vrátil
Browse files

Release idle connections to the database

For Postgres, each DB client connection corresponds to a process
being spawn and kept alive. May even mean some SHM allocated for
it, on pre-9.3 versions of postgres.
On a system (desktop) with many akonadi resources, we may end up
occupying most/all available Postgres backends just keeping idle
agents.
This patch tries to address that, by releasing the DB connection
for those idle agents. This comes to the expense of some wake-up
latency (connect, setup db and prepare queries again). It is not
limited to QPSQL DBs yet, as to explore its effects on the other
storage engines.

Note that I had to change the `DataStore::database()` API from a
const to a regular method, because it would wake-up a connection.

With the help of Daniel Vrátil <dvratil@redhat.com> , who showed
me the way.

REVIEW: 121120
parent e0963789
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