Hi, In FR 3.0, in the NAS network link interruptions, I receive the error *"rlm_sql (sql): Cannot open new connection, already at max"*. What should I pay attention to when increasing the *max_requests* value? Is increasing this value sufficient, or are there any parameters in the SQL pool settings that I also need to increase? Regards
On Jan 15, 2026, at 2:15 AM, Can Paçacı <pacaci@servisnet.com.tr> wrote:
In FR 3.0, in the NAS network link interruptions, I receive the error *"rlm_sql (sql): Cannot open new connection, already at max"*.
What should I pay attention to when increasing the *max_requests* value?
Increasing "max_requests" won't fix an SQL connection issue. You should instead look at the "sql" module configuration. There's a "max" connections setting there. Alan DeKok.
Thanks Alan, What value should I change max value to? I increased it from 40 to 200, is that enough? The following logs were received during the burst and for a certain period afterward: Jan 15 03:54:15 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:35 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:38 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:40 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit On 1/15/26 15:13, Alan DeKok via Freeradius-Users wrote:
On Jan 15, 2026, at 2:15 AM, Can Paçacı <pacaci@servisnet.com.tr> wrote:
In FR 3.0, in the NAS network link interruptions, I receive the error *"rlm_sql (sql): Cannot open new connection, already at max"*.
What should I pay attention to when increasing the *max_requests* value? Increasing "max_requests" won't fix an SQL connection issue. You should instead look at the "sql" module configuration. There's a "max" connections setting there.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jan 15, 2026, at 7:43 AM, Can Paçacı <pacaci@servisnet.com.tr> wrote:
Thanks Alan, What value should I change max value to? I increased it from 40 to 200, is that enough?
It depends on your system. There is no perfect answer which works for all systems.
The following logs were received during the burst and for a certain period afterward:
Jan 15 03:54:15 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:35 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:38 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:40 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit
Yes, that's a sign that the database is overloaded. Adding more connections won't make the database faster. It just means that more packets will be waiting for the database. Instead, you should configure the server so that if the SQL module fails, the accounting data is written to the detail file. Then, use radrelay *after* the traffic peak is over to insert the records into the database. Or, double-check your database to see if you can make it faster. This is a database issue, and changing FreeRADIUS won't make the database faster. Alan DeKok.
Are you sure it's the database? I couldn't find any errors/warnings in the database logs for that time period. I also couldn't find anything wrong in the database report. I am attaching all relevant radiusd full logs related. Is the "max connection limit" value in the logs below the same *max* sql pool parameter you're referring to? Jan 15 03:53:40 srv-1 radiusd[581372]: rlm_sql (sql): Opening additional connection (4354), 41 of 43 pending slots used Jan 15 03:53:40 srv-1 radiusd[581372]: rlm_sql (sql): Opening additional connection (4355), 42 of 43 pending slots used Jan 15 03:53:40 srv-1 radiusd[581372]: rlm_sql (sql): Opening additional connection (4356), 43 of 43 pending slots used Jan 15 03:53:55 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:53:56 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:53:57 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:14 srv-1 radiusd[581372]: rlm_sql (sql): Closing connection (4246), from 13 unused connections Jan 15 03:54:15 srv-1 radiusd[581372]: rlm_sql (sql): Opening additional connection (4357), 1 of 1 pending slots used Jan 15 03:54:15 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:35 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:38 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:40 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:45 srv-1 radiusd[581372]: rlm_sql (sql): Closing connection (4349), from 50 unused connections Jan 15 03:54:48 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:48 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:48 srv-1 radiusd[581372]: rlm_sql (sql): Opening additional connection (4358), 1 of 1 pending slots used Jan 15 03:54:48 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:48 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:48 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:48 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Regards On 1/15/26 15:53, Alan DeKok wrote:
On Jan 15, 2026, at 7:43 AM, Can Paçacı<pacaci@servisnet.com.tr> wrote:
Thanks Alan, What value should I change max value to? I increased it from 40 to 200, is that enough? It depends on your system. There is no perfect answer which works for all systems.
The following logs were received during the burst and for a certain period afterward:
Jan 15 03:54:15 srv-1 radiusd[581372]: rlm_sql (sql): Cannot open new connection, already at max Jan 15 03:54:35 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:38 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Jan 15 03:54:40 srv-1 radiusd[581372]: rlm_sql (sql): No connections available and at max connection limit Yes, that's a sign that the database is overloaded.
Adding more connections won't make the database faster. It just means that more packets will be waiting for the database.
Instead, you should configure the server so that if the SQL module fails, the accounting data is written to the detail file. Then, use radrelay *after* the traffic peak is over to insert the records into the database.
Or, double-check your database to see if you can make it faster. This is a database issue, and changing FreeRADIUS won't make the database faster.
Alan DeKok.
On Jan 15, 2026, at 8:26 AM, Can Paçacı <pacaci@servisnet.com.tr> wrote:
Are you sure it's the database?
I've been doing this since 1997. I think I know a little bit about these issues. If you're going to ask questions on this list, it would be polite to not argue with the answers.
I couldn't find any errors/warnings in the database logs for that time period. I also couldn't find anything wrong in the database report.
That doesn't matter. The database likely won't log anything if queries are taking 100ms instead of 2ms. But FreeRADIUS will notice, and it will complain. So looking at the database logs doesn't help. If FreeRADIUS is complaining, then there IS a real problem. FreeRADIUS doesn't invent random error messages. Why do I say this? When things are OK, FreeRADIUS sends a small number of queries to the database, and it gets responses quickly. So you don't see the "sql max connections" error message. When the load goes up a lot, FreeRADIUS sends many queries to the database, which overloads it. So the responses take a long time. Which means that FreeRADIUS needs to open more connections. And then you see the "sql max connections" error. Since the database is overloaded, increasing the "SQL max connections" configuration won't make the database any faster. The ONLY solutions here are: * decrease the number of packets that the server receives * make the database faster * stop using the database when the server is overloaded Pick one solution, or all of them. What isn't a solution is to ignore the advice you get here, and look for some other random solution. It won't work. Doing anything else will be just a waste of time.
I am attaching all relevant radiusd full logs related. Is the "max connection limit" value in the logs below the same max sql pool parameter you're referring to?
Yes... they all refer to "sql" and "max", so they are all about the "max" connection limit for the "sql" module. Alan DeKok.
participants (2)
-
Alan DeKok -
Can Paçacı