title: How to close open connections in mysql with codeigniter
body: <p>I just want to know how can i close all open connections from mysql and will it increase speed of my web site. </p>
  
  <p>please take a look of mysql status output</p>
  
  <pre><code>Variable_name     Value
  Aborted_connects    1
  Connection_errors_accept    0
  Connection_errors_internal    0
  Connection_errors_max_connections    0
  Connection_errors_peer_address    0
  Connection_errors_select    0
  Connection_errors_tcpwrap    0
  Connections    252
  Max_used_connections    6
  Performance_schema_session_connect_attrs_lost    0
  Ssl_client_connects    0
  Ssl_connect_renegotiates    0
  Ssl_finished_connects    0
  Threads_connected    1
  </code></pre>
  
  <p>I am using code-igniter v3 for my project with the following db settings in database.php</p>
  
  <pre><code>$active_group = 'default';
  $query_builder = TRUE;
  
  $db['default'] = array(
      'dsn'   =&gt; '',
      'hostname' =&gt; 'localhost',
      'username' =&gt; 'root',
      'password' =&gt; '#######',
      'database' =&gt; '#######',
      'dbdriver' =&gt; 'mysqli',
      'dbprefix' =&gt; '',
      'pconnect' =&gt; FALSE,
      'db_debug' =&gt; (ENVIRONMENT !== 'production'),
      'cache_on' =&gt; FALSE,
      'cachedir' =&gt; '',
      'char_set' =&gt; 'utf8',
      'dbcollat' =&gt; 'utf8_general_ci',
      'swap_pre' =&gt; '',
      'encrypt' =&gt; FALSE,
      'compress' =&gt; FALSE,
      'stricton' =&gt; FALSE,
      'failover' =&gt; array(),
      'save_queries' =&gt; TRUE
  );
  </code></pre>