[eluser]gbar[/eluser]
Hello. I am having a problem of freezing the application.
With a frequency of seemingly random, and without that necessarily has to load pages with a lot of sql queries, if i click any link of my application, it will remain paralyzed for several minutes (up to 5 minutes!), then the page is loading.
If during one of these long waits, I click again on the same link or other, the page loads fast. it's like suddenly everything is paralyzed, and I do not get any timeout error.
The benchmark, even after one of those cases where the application freezes for minutes at the end of the load signals a good time to load. Benchmark not report the real minutes that i wait.
Of course I searched the forums far and wide, and I found some similar problem, and I applied all the solutions that I found.
1) I recreated the database with collation utf8_general_ci and set to utf 8 char as the database configuration file, i put below the settings.
The problem occurs even if I remove the persistent connection.
2) I set in the configuration file, using the sessions with the database and CSRF protection. I tried for a long time to hold these options disabled, the problem remains.
3) I almost emptied the autoload files, i load the database class in the constructor of each model, load the classes Session, form_validation, and other helpers only where it is needed within the controller constructor.
The situation seems to improve at times, but then the problem comes back.
The application is online on a server Hostgator baby.
It may also depend on server settings? php.ini to be revised? I do not know much about this.
Here are a few place settings of the application, I hope someone help me find the solution.
Many Thanks everyone
config/database.php
Code:
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '****';
$db['default']['password'] = '****';
$db['default']['database'] = '****';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$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;
config/routes.php
Code:
$route['default_controller'] = "site";
$route['404_override'] = '';
$route['admin'] = "admin/dashboard";
config/config.php
Code:
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
$config['language'] = 'english';
$config['charset'] = 'UTF-8';
$config['enable_hooks'] = FALSE;
$config['subclass_prefix'] = 'MY_';
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
$config['log_threshold'] = 0;
$config['log_path'] = '';
$config['log_date_format'] = 'Y-m-d H:i:s';
$config['cache_path'] = '';
$config['encryption_key'] = '*****';
$config['sess_cookie_name'] = '*****';
$config['sess_expiration'] = 1200;
$config['sess_expire_on_close'] = TRUE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = '*****';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
$config['global_xss_filtering'] = FALSE;
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_test';
$config['csrf_cookie_name'] = 'csrf_cookie';
$config['csrf_expire'] = 1200;
$config['compress_output'] = TRUE;
$config['time_reference'] = 'local';
$config['rewrite_short_tags'] = FALSE;
$config['proxy_ips'] = '';