rlm_sql_null: No connections available and at max connection limit

Alan DeKok aland at deployingradius.com
Thu Jun 3 22:23:00 CEST 2021

On Jun 3, 2021, at 4:17 PM, Artis Caune <artis.caune at gmail.com> wrote:
> We use rlm_sql_null for accounting and auth logs which allow us to respond
> quickly and defer inserts from regional nodes when db or link is down.
> Config is simple:
> accounting {
>    ...
>    sql_accounting
> }
> sql sql_accounting {
>        driver = "rlm_sql_null"
>        accounting {
>                logfile = "${sql_write_dir}/accounting.sql"
>                query = "INSERT INTO accounting ..."
>        }
> }
> We get around 10-15 auth requests per sec and I don't see any errors for
> post-auth log.
> But we get around 180-200 acct requests per sec and I'm getting those
> errors for rlm_sql_null module:
> rlm_sql (sql_accounting): Cannot open new connection, already at max
> rlm_sql (sql_accounting): No connections available and at max connection
> limit

  Yeah, the main SQL module doesn't know that the "rlm_sql_null" driver doesn't connect to a real database.  It's the one downside of the abstractions we use.

> README.rst says we can leave the pool definition or delete it for _null
> module.
> Wondering if there are some tweaks for the null module or it's a bug as
> there should be no max connection limit on this module ?

  Just configure a "pool" section, and set the maximum connection limit to a high value.  It will be fine.

> Also noticed that null module tries to connect to radius table but no
> db_name is configured:
> rlm_sql (sql_accounting): Driver rlm_sql_null (module rlm_sql_null) loaded
> and linked
> rlm_sql (sql_accounting): Attempting to connect to database "radius"
> Why is it trying to connect to something if it should just append to
> logfile ?

  That's just an information message.  It doesn't mean anything for the rlm_sql_null driver.  It can be ignored.

  It's another side effect of the main SQL module not knowing that there's any difference between PostgreSQL, MySQL, Oracle, or NULL.

  Alan DeKok.

More information about the Freeradius-Users mailing list