Speeding-up Joomla tests on Windows7

Rate this item
(0 votes)

Performing Selenium web tests on powerfull Win7 computer (16GB RAM, processor i7-2600) all page responses were above 1 sec. Such reponse on Joomla 2.5 or Joomla 3.0 with sparse content is not acceptable result.

Starting with Profiler was found that calling only PHP function 'session_start();' in Joomla 2.5 initialisation
(JFactory::getSession() -> $session = JSession::getInstance($handler, $options))
causes itself approx.1 sec. long processing.

Changing session handler in Joomla Global Configuration from 'Database' to 'Memcache' was entire response time not much changed and 1 sec. lag moved to other part of core Joomla code - to the initial call of
$db = JFactory::getDBO();

 

Here was recognized as long running (about 1 sec.) following single command (in /libraries/joomla/database/database/mysqli.php file) :
$this->connection = @mysqli_connect(
            $options['host'],
            $options['user'],
            $options['password'],
            null,
            $options['port'],
            $options['socket']);
Generally is known that creating new database connection is time consuming process but that this process will be so big obstacle by response processing in time of Joomla 2.5+ and PHP 5.3 was very suprising.

Looking for very simple solution with faster processing speed here was taken as the best one so called persistent database connection. For sure it is solution maybe not suitable for all types of websites and operating systems (here is plenty of discussions pro/contra e.g. http://www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/) but in development/testing environment has advantage. Simply changing above command to :

$this->connection = @mysqli_connect(
            'p:'.$options['host'],
            $options['user'],
            $options['password'],
            null,
            $options['port'],
            $options['socket']);
see prepended 'p:' before host option () - details can be found on http://www.php.net/manual/en/mysqli.construct.php.

Results with persistent connection are very good - responses of simple catched pages are now approx. 100ms (against >1000 ms before change) and overall running time of complex Selenium tests is much shorter (more as half of previous run time - gain more as 50%).

Performing Selenium web tests on powerfull Win7 computer (16GB RAM, processor i7-2600) all page responses were above 1 sec. Such reponse on Joomla 2.5 or Joomla 3.0 with sparse content is not acceptable result.

 

Starting with Profiler was found that calling only PHP function 'session_start();' in Joomla 2.5 initialisation

(JFactory::getSession() -> $session = JSession::getInstance($handler, $options))

causes itself approx.1 sec. long processing.

 

Changing session handler in Joomla Global Configuration from 'Database' to 'Memcache' was entire response time not much changed and 1 sec. lag moved to other part of core Joomla code - to the initial call of

$db = JFactory::getDBO();

 

Here was recognized as long running (about 1 sec.) following single command (in /libraries/joomla/database/database/mysqli.php file) :

$this->connection = @mysqli_connect(

                                   $options['host'],

                                   $options['user'],

                                   $options['password'],

                                   null,

                                   $options['port'],

                                   $options['socket']);

Generally is known that creating new database connection is time consuming process but that this process will be so big obstacle by response processing in time of Joomla 2.5+ and PHP 5.3 was very suprising.

 

Looking for very simple solution with faster processing speed here was taken as the best one so called persistent database connection. For sure it is solution maybe not suitable for all types of websites and operating systems (here is plenty of discussions pro/contra e.g. http://www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/) but in development/testing environment has advantage. Simply changing above command to :

 

$this->connection = @mysqli_connect(

                                   'p:'.$options['host'],

                                   $options['user'],

                                   $options['password'],

                                   null,

                                   $options['port'],

                                   $options['socket']);

see prepended 'p:' before host option () - details can be found on http://www.php.net/manual/en/mysqli.construct.php.

 

Results with persistent connection are very good - responses of simple catched pages are now approx. 100ms (against >1000 ms before change) and overall running time of complex Selenium tests is much shorter (more as half of previous run time - gain more as 50%).
Read 2688 times Last modified onWednesday, 31 October 2012 17:48

Only registred users have rights to post comments. Please log-in or create an account.

We have 76 guests and no members online
Copyright © 2015 JotComponents
We have 76 guests and no members online
Copyright © 2017 JotComponents