Skip to content

Commit

Permalink
Add support to vary the number of SQL sockets made
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Gazeley committed Nov 11, 2014
1 parent ba5ed08 commit a1634a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ Default: `undef`. Required. Password to connect to the database.
Default: `radius`. Name of the database. Normally you should leave this alone. If you are using Oracle then use this instead:
`(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=your_sid)))`.

##### `num_sql_socks`

Default: same as `max_servers`. Number of sql connections to make to the database server.
Setting this to LESS than the number of threads means that some threads may starve, and
you will see errors like "No connections available and at max connection limit". Setting
this to MORE than the number of threads means that there are more connections than necessary.
Leave blank to set it to the same value as the number of threads.

```puppet
freeradius::sql { 'mydatabase':
database => 'mysql',
Expand Down
1 change: 1 addition & 0 deletions manifests/sql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$server = 'localhost',
$login = 'radius',
$radius_db = 'radius',
$num_sql_socks = '${thread[pool].max_servers}',
) {
$fr_package = $::freeradius::params::fr_package
$fr_service = $::freeradius::params::fr_service
Expand Down
2 changes: 1 addition & 1 deletion templates/sql.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sql {
# Setting this to MORE than the number of threads means
# that there are more connections than necessary.
#
num_sql_socks = ${thread[pool].max_servers}
num_sql_socks = <%= @num_sql_socks %>

# number of seconds to dely retrying on a failed database
# connection (per_socket)
Expand Down

0 comments on commit a1634a2

Please sign in to comment.