[eluser]Sweden[/eluser]
Hello!
I’m having a problem with CodeIgniter that it’s taking over 1 second to load every time.
I have navigated this down to being problem with the database connection that’s taking over 1 second to connect.
I’ve read some people having this issue too in PHP who have solved it by changing the server from “localhost” to 127.0.0.1, this however only solves it for me in application not using CodeIgniter.
I’ve come to this after disabling everything on autoload (Controller Execution Time: 0.0029), but when putting database on autoload it gets slow (Controller Execution Time: 1.0172) even when no queries are run.
Does anyone have any idea what could be causing this?
Some settings:
Code:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update'] = 300;
$db['default']['hostname'] = 'mysql:127.0.0.1';
$db['default']['username'] = DBUSER;
$db['default']['password'] = DBPASS;
$db['default']['database'] = DATABASE;
$db['default']['dbdriver'] = 'pdo';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;