Skip to content

add a maximum connection parameter and set the default to 1000 #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
$pidfile = $mysql::pidfile,
$port = $mysql::port,
$purge_conf_dir = $mysql::purge_conf_dir,
$max_connections = $mysql::max_connections,
$restart = $mysql::restart,
$root_group = $mysql::root_group,
$root_password = $mysql::root_password,
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
$port = $mysql::params::port,
$purge_conf_dir = $mysql::params::purge_conf_dir,
$python_package_name = $mysql::params::python_package_name,
$max_connections = $mysql::params::max_connections,
$restart = $mysql::params::restart,
$root_group = $mysql::params::root_group,
$root_password = $mysql::params::root_password,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
$old_root_password = ''
$package_ensure = 'present'
$purge_conf_dir = false
$max_connections = 151
$port = 3306
$max_allowed_packet = '16M'
$root_password = 'UNSET'
Expand Down
52 changes: 27 additions & 25 deletions spec/classes/mysql_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{
:root_password => 'UNSET',
:old_root_password => '',
:max_connections => '151',
:bind_address => '127.0.0.1',
:port => '3306',
:max_allowed_packet => '16M',
Expand All @@ -18,34 +19,34 @@
describe 'with osfamily specific defaults' do
{
'Debian' => {
:datadir => '/var/lib/mysql',
:service_name => 'mysql',
:config_file => '/etc/mysql/my.cnf',
:socket => '/var/run/mysqld/mysqld.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
:datadir => '/var/lib/mysql',
:service_name => 'mysql',
:config_file => '/etc/mysql/my.cnf',
:socket => '/var/run/mysqld/mysqld.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
},
'FreeBSD' => {
:datadir => '/var/db/mysql',
:service_name => 'mysql-server',
:config_file => '/var/db/mysql/my.cnf',
:socket => '/tmp/mysql.sock',
:pidfile => '/var/db/mysql/mysql.pid',
:root_group => 'wheel',
:datadir => '/var/db/mysql',
:service_name => 'mysql-server',
:config_file => '/var/db/mysql/my.cnf',
:socket => '/tmp/mysql.sock',
:pidfile => '/var/db/mysql/mysql.pid',
:root_group => 'wheel'
},
'RedHat' => {
:datadir => '/var/lib/mysql',
:service_name => 'mysqld',
:config_file => '/etc/my.cnf',
:socket => '/var/lib/mysql/mysql.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
:datadir => '/var/lib/mysql',
:service_name => 'mysqld',
:config_file => '/etc/my.cnf',
:socket => '/var/lib/mysql/mysql.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
}
}.each do |osfamily, osparams|

Expand Down Expand Up @@ -161,6 +162,7 @@
"socket = #{param_values[:socket]}",
"pid-file = #{param_values[:pidfile]}",
"datadir = #{param_values[:datadir]}",
"max_connections = #{param_values[:max_connections]}",
"bind-address = #{param_values[:bind_address]}",
"max_allowed_packet = #{param_values[:max_allowed_packet]}"
]
Expand Down Expand Up @@ -226,7 +228,7 @@

describe 'unset ssl params should fail when ssl is true on freebsd' do
let :facts do
{:osfamily => 'FreeBSD'}
{:osfamily => 'FreeBSD'}
end

let :params do
Expand Down
1 change: 1 addition & 0 deletions templates/my.cnf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ port = <%= @port %>
basedir = <%= @basedir %>
datadir = <%= @datadir %>
tmpdir = <%= @tmpdir %>
max_connections = <%= @max_connections %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does mysql have a default max_connections that we could use? It seems like adding this may be considered backwards incompatible otherwise, since it previously was unaccounted for.

skip-external-locking

<% if @bind_address %>
Expand Down