FR behavior when DB not available

Nick Porter nick at portercomputing.co.uk
Mon Jul 17 11:06:56 UTC 2023


On 17/07/2023 03:22, Anatoliy wrote:
> So sql query always block core thread, and only option is to find way for
> faster detect that tcp session to DB fails ? For example max_retries option
> introduced in 3.2.3.

The max_retries option was added to prevent every possible connection 
being tried when a query fails - so it does improve the speed of 
detecting failures.

With MySQL / MariaDB as the database you also want to look at the 
query_timeout option.  Not all the database client libraries support 
setting a timeout, but the MySQL client does.

> But I think that retry_delay option should prevent all threads from
> connecting to DB for some time, if previous connection is fails. And these
> messages tells about this , or my understanding is wrong ? Increasing
> retry_delay should help faster reply to NAS with Access-Accept.
retry_delay puts a delay on attempting to bring up new database 
connections if the previous attempt failed.  It is a balancing act 
between persistently attempting to bring up new connections when 
something is wrong, and just saying "this didn't work last time, we're 
going to wait a while before we try again", which can cause a slower 
recovery when the database is available again.

-- 
Nick Porter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 665 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20230717/38290147/attachment.sig>


More information about the Freeradius-Users mailing list