How to fix OVH hosting slowness problem - question about sessions from the database

Permalink
After a long time figuring how to fix slowness on some websites hosted on the OVH hosting company, I share with you this little howto. Feel free to post your thoughts.

1° Be sure to have these lines in your .htaccess
SetEnv REGISTER_GLOBALS 0 
SetEnv ZEND_OPTIMIZER 1 
SetEnv MAGIC_QUOTES 1 
SetEnv PHP_VER 5.4


2° Apply the gregjoyce's tip (thanks to him) :http://www.concrete5.org/documentation/how-tos/developers/handle-se...
This permits to use mysql db for sessions instead of files. I think there's a problem with OVH at this point, as OVH recommands to use DB also for Piwik web analytics module. Problem occurs on some JS generated files, like page_controls_menu_js.php or i18n_js.php, especially on edit mode.

3° Remove DB connection closing, either by commenting all calls to /concrete/startup/shutdown.php
//require(DIR_BASE_CORE . '/startup/shutdown.php');
or by commenting the following line //
$db->disconnect();
of /concrete/startup/shutdown.php.

I think it would be nice to have this db sessions possibility directly in the core. Could it be added in future versions ?

Regards

djes
 
djes replied on at Permalink Reply
djes
Another solution is to change concrete's sessions default folder ('/files/tmp'), and let the OVH's default which is on a faster cluster. For this, add the following line to config/site.php

define('DIR_SESSIONS', session_save_path());
sboye replied on at Permalink Reply
Thanks a lot djes !!
You saved my life :)
djes replied on at Permalink Reply
djes
My pleasure ;)
You may follow the thread on the french forum there :http://board.concrete5.fr/viewtopic.php?t=570...