CodeIgniter Forums
[SOLVED] - Problem of application freezing - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: [SOLVED] - Problem of application freezing (/thread-43423.html)



[SOLVED] - Problem of application freezing - El Forum - 07-11-2011

[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'] = '';



[SOLVED] - Problem of application freezing - El Forum - 07-11-2011

[eluser]gbar[/eluser]
... and this is may .htaccess, very normal...

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]



[SOLVED] - Problem of application freezing - El Forum - 07-11-2011

[eluser]n0xie[/eluser]
Do your logs show anything out of the ordinary? It seems to me that once every X times, one of the PHP processes dies, and it gets restarted after X minutes. This would imply that it's more a server config problem than a CodeIgniter problem.


[SOLVED] - Problem of application freezing - El Forum - 07-11-2011

[eluser]gbar[/eluser]
Hello, thanks for your answer. The log file of my server is completely empty, there is nothing ... likely to be disabled, i ask to the client service... I have seen, however, that in the php-ini I've disabled some functions that put security at risk at the time because I was used Joomla ... Now I see what happens ... i've removed them


[SOLVED] - Problem of application freezing - El Forum - 07-11-2011

[eluser]gbar[/eluser]
ok, it was a server problem solved by the assistance. The above settings are correct. thanks


[SOLVED] - Problem of application freezing - El Forum - 07-14-2011

[eluser]Unknown[/eluser]
I have the same problem ,on hostgator, and they said there is nothing that can be done. What did they say to you?