Commit a1634a27 authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

Add support to vary the number of SQL sockets made

parent ba5ed087
Loading
Loading
Loading
Loading
+8 −0
Changes for README.md: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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',
+1 −0
Changes for manifests/sql.pp: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ define freeradius::sql (
  $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
+1 −1
Changes for templates/sql.conf.erb: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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)