I should have provided this detail: The second before all the jobs
launch there are 2 database connections. Probably one steady state for
the director and one for the bconsole I was running. But from 2 to 100
DB connections for 10 concurrent jobs seems overkill.
It almost smells like each of the scheduled jobs when they switch from
the "Scheduled Jobs" queue to the "Running Jobs" queue creates a brand
new DB connection.
I'll try the "spool attributes" option, seems sensible anyway. But since
the bulk of the connections ran the query "SELECT count(*) from Media
WHERE PoolId=3" it seems un-related to spooling attributes.
On 11/3/16 11:44 AM, Stephan Dühr wrote:
Hi Douglas,
that looks like too many connections for 10 concurrent jobs.
Do you have spooling (Data or Attribute Spooling) enabled?
See
http://doc.bareos.org/master/html/bareos-manual-main-reference.html#directiveDirJobSpool%20Attributes
I'd recommend at least
Spool Attributes = yes
because the DB inserts are batched then, so much more efficient.
But even without spooling, 100 DB connections for 10 concurrent jobs
seem to be too many.
Note that console (eg. bconsole or from webui) connections also cause a DB
connection each.
Regards,
Stephan
On 11/03/2016 03:58 PM, Douglas K. Rand wrote:
I'm a little startled at how many connections Bareos makes to Postgres.
We have currently have 88 backup jobs scheduled to start each day in the
evening. The max current jobs that we run is 10. For this Bareos makes
about 100 separate connections to Postgres, which seems quite high.
I've attached the results of these commands which ran just as Bareos was
kicking off the backup schedule:
# Get all of the Postgres connections and recent commands
psql --pset=pager=off --user=bareos --dbname=bareos \
--command="SELECT usename, pid, state, query FROM pg_stat_activity"
# List all connections to postgresql
lsof -i :postgresql
List all Bareos processes and threads
ps -axlwwH -U bareos
I've had to increase max_connections up to 150 in order to avoid Bareos
from failing some jobs due to Postgres refusing additional connections.
From the lsof command you can see 100 established TCP connections from
Bareos to Postgres. Even though there seems to be only 26 Bareos threads.
This is Bareos 15.2.2 on FreeBSD 10.2.
Thoughts on this behavior?
--
You received this message because you are subscribed to the Google Groups
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.