BzZzZ - ustvarjamo podobe logo
slovenščina
english
Disable statistics collection in Joomla - less backups, faster response

In Joomla 1.0 (or Mambo before that) one could simply disable statistics collection by choosing equaly named option in global configuration - guess what, this is not possible in 1.5. and it looks like it also won't be possible in 1.6.

While article view and weblink clicks statistics are a nice feature for low traffic sites there are number of problems arising from it - basically this kind of statistics means that for every pageview or link click Joomla has to write new data to a database. This has numerous implications:

  • On every article view Mysql UPDATE has to be run which slows a site down by itself
  • Constantly updated tables can't be cached by Mysql query cache (another slowdown)
  • If you are doing incremental/differential backups that store only changed parts of your site, new backup of the database will be created on every run even if your site hasn't changed for a long time. If you use remote backup services like Amazon S3 this will directly result in increased charges. With multiple sites or even few 1000 accounts holding multiple sites each in case of shared hosting providers, numbers can get quite significant.
  • If you are using built-in Joomla view cache (activated by turning on caching in global configuration) article statistic won't work anyway - page view is recorded only when cache expires and com_content is actually run to recreate it and so this statistic is totally unreliable.

 

By using this simple hack you can shrink your backups and improve your Joomla site's performance at the same time:

 

Joomla 1.5.

comment out line 65 in component/com_content/views/article/view.html.php

//$model->hit();

 

and line 46 of components/com_weblinks/controller.php

//$model->hit();

 

Joomla 1.6.

Weblinks got a parameters option for disabling click recording and so hack is only needed for com_content . The location and the code that needs to be commented out is the same as in 1.5., but the line number has changed - code is now found at line 145.

Alternatively you can apply global_counters_1.patch patch that can be found on Joomla tracker: http://bit.ly/ddhUht . The patch will add an option for statistics collection (counters on/off) in global configuration and in com_content parameters.

 

 
  • strateško usmerjeno
  • integrirano
  • s kreativnostjo pospešeno
  • učinkovito komuniciranje
© BzZzZ 2008
stik z nami    zaposlitev    kazalo strani