Piwik performance

I’m curious if there’s a workaround for some performance issues I’m having. I’ve just recently installed 0.6.3 and started tracking stats for only a few days on one site that has over 10k visits per day. Performance seemed ok with just the one site setup. Yesterday I added another 297 sites via the api and almost all have 0 or 1 hit since I only installed the tracking javascript for a second.

Since adding those sites, when I click ‘All Websites’, it now takes almost 5 minutes to load, like it’s trying to process stats for every site onclick. I’ve upped the timeout on php script in php.ini to get it to work from 30 seconds to 300 seconds. I noticed there is a 5 minute javascript refresh on the ‘All Websites’ page I can probably disable, but the php script timeouts seem to continue to be from one of two errors:

1

/core/Log.php at line 155…return array_map below:


class Piwik_Log_Formatter_ScreenFormatter implements Zend_Log_Formatter_Interface
{
        function formatEvent($event)
        {
                // no injection in error messages, backtrace when displayed on screen
                return array_map('htmlspecialchars', $event);
        }


Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/vhosts/mywebsite.com/httpdocs/core/Log.php on line 155

or

2

/core/ErrorHandler.php on line 46…

debug_print_backtrace();

When the second error occurs, it usually has a ton of code dumped out before the error starting with:

#0 Piwik_ErrorHandler(2048, Only variables should be passed by reference, /var/www/vhosts/mywebsite.com/httpdocs/plugins/MultiSites/Controller.php, 159, Array ([lastVisits] => Piwik_DataTable_Array Object ([metadata] => Array (),[] => Array ([1] => Piwik_DataTable_Simple Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([0] => 35009),[1] => Array (),[3] => ))),[] => 894,[] => 0,[] => 1,[] => ,[] => ,[] => Array (),[] => 0,[] => ,[] => ),[12] => Piwik_DataTable_Simple Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([0] => 1),[1] => Array (),[3] => ))),[] => 895,[] => 0,[] => 1,[] => ,[] => ,[] => Array (),[] => 0,[] => ,[] => ),[13] => Piwik_DataTable_Simple Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([0] => 0),[1] => Array (),[3] => ))),[] => 896,[] => 0,[] => 1,[] => ,[] => ,[] => Array (),[] => 0,[] => ,[] => ),[14] => Piwik_DataTable_Simple Object ([] => Array ([0] => Piwik_DataTable_Row Object ([c] => Array ([0] => Array ([0] => 0),[1] => Array (),[3] => ))),[] => 897,[] => 0,[] => 1,[] => ,[] => ,[] => Array (),[] => 0,[] => ,[] => ),[15] => Piwik_DataTable_Simple Object …

and on and on and eventually ending with:


Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/vhosts/mywebsite.com/httpdocs/core/ErrorHandler.php on line 46

I’m logging slow mysql queries but that doesn’t seem to be the problem.

This is only for 298 sites total, so I’m hesitant to add a few more thousand I’d like to track.

Hopefully this is already known about, but I didn’t see any other messages in the forum.

**Edit
I’m running piwik on a dedicated server with a single, quad core processor, rhel5 64bit, 2 gigs of ram and 3 15krpm drives with raid5.

I’ve also applied all the performance tips I could find including:
Upping the php memory limit to 256MB
Turning off browser based archiving
Changing processing to every 3600 seconds
Changing the php timeout to 300 seconds so I can still view the ‘All Websites’ page

Thanks,
David

Thanks for the report - this is indeed a known bug, see http://dev.piwik.org/trac/ticket/1077
Maciej hopes to get it fixed soon