[asterisk-dev] Realtime Failover - Multiple DSNs
tilghman at meg.abyt.es
Mon Jun 27 14:02:38 CDT 2011
On Monday 27 June 2011 11:48:02 Stuart Elvish wrote:
> Did I miss the documentation for using multiple DSN's in extconfig.conf?
Possibly. It's a new feature, starting in 1.8. The related documentation
in the sample file is the second paragraph that starts with "Additionally".
> From looking at the comments in the source code,
> negative_connection_cache is the number of seconds to cache the
> information if there is a problem. Is that correct? Is there anything
> that should be considered before changing this figure?
It's the number of seconds for which a connection failure will be cached
and that connection not retried. Because there's a possible penalty
(delay) in attempting to connect to a database and failing, you don't want
to do it too often. However, on the opposite end, you also want the
connections to go back to the original database, when it has recovered. If
your negative connection cache is 86400, then the soonest that it will
go back to that primary will be 86400 seconds (24 hours) after the initial
failure. (It's not exactly that, because this is an on-demand system --
it's the next attempt to obtain that handle AFTER that period has elapsed.)
The default is 300 seconds, or 5 minutes. If your other databases are
perfectly able to take the load, you can increase that to 3600 (1 hour) or
even 86400 (1 day) or more. Just remember that this is a priority system,
not a load balancing system.
You may also wish to tweak the connection timeout values in res_odbc.conf.
For example, if you know the connection is normally instantaneous, then a
connect_timeout of 1 second would be fine and would speed the failover.
More information about the asterisk-dev