Skip to content

Commit a1634a2

Browse files
author
Jonathan Gazeley
committed
Add support to vary the number of SQL sockets made
1 parent ba5ed08 commit a1634a2

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ Default: `undef`. Required. Password to connect to the database.
266266
Default: `radius`. Name of the database. Normally you should leave this alone. If you are using Oracle then use this instead:
267267
`(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=your_sid)))`.
268268

269+
##### `num_sql_socks`
270+
271+
Default: same as `max_servers`. Number of sql connections to make to the database server.
272+
Setting this to LESS than the number of threads means that some threads may starve, and
273+
you will see errors like "No connections available and at max connection limit". Setting
274+
this to MORE than the number of threads means that there are more connections than necessary.
275+
Leave blank to set it to the same value as the number of threads.
276+
269277
```puppet
270278
freeradius::sql { 'mydatabase':
271279
database => 'mysql',

manifests/sql.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
$server = 'localhost',
66
$login = 'radius',
77
$radius_db = 'radius',
8+
$num_sql_socks = '${thread[pool].max_servers}',
89
) {
910
$fr_package = $::freeradius::params::fr_package
1011
$fr_service = $::freeradius::params::fr_service

templates/sql.conf.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ sql {
8282
# Setting this to MORE than the number of threads means
8383
# that there are more connections than necessary.
8484
#
85-
num_sql_socks = ${thread[pool].max_servers}
85+
num_sql_socks = <%= @num_sql_socks %>
8686

8787
# number of seconds to dely retrying on a failed database
8888
# connection (per_socket)

0 commit comments

Comments
 (0)