I am having a very annoying issue, I could not find a solution or cause. Very rarely, calling a CodeIgniter function it stucks for about 15 minutes. I was able to find, that CI database load is causing such issue. After 15 minutes get an error MySQL server has gone away.
My database config:
$db['local'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '******',
'password' => '********',
'database' => '********',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => true,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => false,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => false,
'compress' => false,
'stricton' => false,
'failover' => array(),
'save_queries' => true,
);