rlm_sql Closing Connections

Ammad Ali ammad.ali at rapidcompute.com
Mon Dec 7 08:29:21 CET 2020


Hi Guys,

I am having below logs in my radius.log file. The connections are 
getting closed and some it suddenly got utilized and radius spawns new 
connections and it takes time to spawn.

Also connections are getting closed even the idle timeout isn't reached. 
Please advise. Below are the logs.

Mon Dec  7 12:11:06 2020 : Info: Ready to process requests

Mon Dec  7 12:11:31 2020 : Warning: rlm_sql (sql): 22 of 22 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:11:31 2020 : Error: rlm_sql (sql): Cannot open new 
connection, connection spawning already in progress
Mon Dec  7 12:11:31 2020 : Warning: rlm_sql (sql): 23 of 23 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:11:31 2020 : Info: rlm_sql (sql): Opening additional 
connection (23)
Mon Dec  7 12:11:31 2020 : Warning: rlm_sql (sql): 23 of 23 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:11:31 2020 : Error: rlm_sql (sql): Cannot open new 
connection, connection spawning already in progress
Mon Dec  7 12:11:52 2020 : Warning: rlm_sql (sql): 24 of 24 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:11:52 2020 : Info: rlm_sql (sql): Opening additional 
connection (24)

Mon Dec  7 12:13:31 2020 : Info: rlm_sql (sql): Closing connection (15), 
from 19 unused connections
Mon Dec  7 12:13:46 2020 : Info: rlm_sql (sql): Closing connection (27), 
from 18 unused connections
Mon Dec  7 12:13:53 2020 : Info: rlm_sql (sql): Closing connection (4), 
from 17 unused connections
Mon Dec  7 12:13:56 2020 : Info: rlm_sql (sql): Closing connection (21), 
from 16 unused connections
Mon Dec  7 12:13:57 2020 : Info: rlm_sql (sql): Closing connection (2), 
from 15 unused connections
Mon Dec  7 12:13:58 2020 : Info: rlm_sql (sql): Closing connection (12), 
from 14 unused connections
Mon Dec  7 12:13:59 2020 : Info: rlm_sql (sql): Closing connection (13), 
from 13 unused connections
Mon Dec  7 12:14:00 2020 : Info: rlm_sql (sql): Closing connection (29), 
from 12 unused connections
Mon Dec  7 12:14:01 2020 : Info: rlm_sql (sql): Closing connection (18), 
from 9 unused connections
Mon Dec  7 12:14:02 2020 : Info: rlm_sql (sql): Closing connection (36), 
from 10 unused connections
Mon Dec  7 12:14:03 2020 : Info: rlm_sql (sql): Closing connection (33), 
from 9 unused connections
Mon Dec  7 12:14:04 2020 : Info: rlm_sql (sql): Closing connection (17), 
from 8 unused connections
Mon Dec  7 12:14:05 2020 : Info: rlm_sql (sql): Closing connection (23), 
from 7 unused connections
Mon Dec  7 12:14:06 2020 : Info: rlm_sql (sql): Closing connection (8), 
from 6 unused connections
Mon Dec  7 12:14:07 2020 : Info: rlm_sql (sql): Closing connection (37), 
from 5 unused connections
Mon Dec  7 12:14:08 2020 : Info: rlm_sql (sql): Closing connection (35), 
from 3 unused connections
Mon Dec  7 12:14:09 2020 : Info: rlm_sql (sql): Closing connection (14), 
from 3 unused connections
Mon Dec  7 12:14:10 2020 : Info: rlm_sql (sql): Closing connection (31), 
from 2 unused connections
Mon Dec  7 12:14:11 2020 : Info: rlm_sql (sql): Closing connection (11), 
from 1 unused connections
Mon Dec  7 12:14:20 2020 : Warning: rlm_sql (sql): 20 of 20 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:14:20 2020 : Info: rlm_sql (sql): Opening additional 
connection (40)
Mon Dec  7 12:14:20 2020 : Warning: rlm_sql (sql): 20 of 20 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:14:20 2020 : Error: rlm_sql (sql): Cannot open new 
connection, connection spawning already in progress
Mon Dec  7 12:14:20 2020 : Warning: rlm_sql (sql): 20 of 20 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:14:20 2020 : Error: rlm_sql (sql): Cannot open new 
connection, connection spawning already in progress
Mon Dec  7 12:14:20 2020 : Warning: rlm_sql (sql): 21 of 21 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:14:20 2020 : Info: rlm_sql (sql): Opening additional 
connection (41)
Mon Dec  7 12:14:20 2020 : Warning: rlm_sql (sql): 21 of 21 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:14:20 2020 : Error: rlm_sql (sql): Cannot open new 
connection, connection spawning already in progress
Mon Dec  7 12:14:20 2020 : Warning: rlm_sql (sql): 22 of 22 connections 
in use.  You probably need to increase "spare"
Mon Dec  7 12:14:20 2020 : Info: rlm_sql (sql): Opening additional 
connection (42)


Below are my sql config of radius.

sql {
         driver = "rlm_sql_mysql"
         dialect = "mysql"
         server = "localhost"
         port = 3306
         login = "nbbdb"
         radius_db = "nbbdb"
         acct_table1 = "radacct"
         acct_table2 = "radacct"
         postauth_table = "radpostauth"
         authcheck_table = "radcheck"
         groupcheck_table = "radgroupcheck"
         authreply_table = "radreply"
         groupreply_table = "radgroupreply"
         usergroup_table = "radusergroup"
         delete_stale_sessions = yes
         pool {
                 min = 20
                 max = ${thread[pool].max_servers}
                 spare = 20
                 uses = 0
                 lifetime = 0
                 idle_timeout = 900
         }
         client_table = "nas"
         $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}

-- 


More information about the Freeradius-Users mailing list