Slow performance with tracker code

We are seeing slow performance on the tracker code side piwik.

I have two piwik 1.5 servers running on windows using apache. The one that our monitored sites load (server A) from and one we run reports from (server B).

I am seeing load times for the tracker code (using firebug) upwards of 30 seconds. When I load the admin portal on server A it is very slow. Looking at the admin portal on Server B and the performance is fine.

The mysql database is around 8.4 gb and is on Server B and the CPU usage hovers around 3%

While getting the poor performance I have a php_info page that I use for testing. It also slows down. If I test a page loaded from apache everything works fine. If I restart apache on server a I get a temporary boost in performance. I can also remove one of the heavy hitting sites and get decent performance as well…

I suspect the the problem is somewhere on the PHP side of server A but I am at a loss at how to find it…

right now I am monitoring 10 sites and have so far today (11 am) tracked around 100k actions… I have 20 other sites that I am waiting to put this back on and will be in the 1,000,000+ size when ready…

please let me know if you need any additional info… if I can’t figure this out we will need to drop piwik and look for something else

Please enable mysql slow query log, and see if there is any slow queries being logged during tracking (which should not happen!)

If this does not lead to interesting slow queries, try disable the plugin “Provider” which does the DNS lookup which could be slow if your dns server is malfunctionning

Let me know if it helps?

the only slow query I get is this :

User@Host: siwik[siwik] @ []

Query_time: 0.000000 Lock_time: 0.000000 Rows_sent: 38 Rows_examined: 38

SET timestamp=1315912936;
SELECT * FROM piwik_log_profiling;

I decided to move the front facing piwik server over to a linux box and after a little tuning on apache I am happy with the performance… we are seeing around 200-500 ms response times now. Yesterday I had 1.8 million page views according to piwik. After tuning I had around 70-120 (mostly at the lower end) httpd threads on the piwik server and a load average of between 1 and 3 during our peek window on a two cpu box (a VM running in vmware w/ 4gb of memory)

I changed my timeout to 15 & my MaxRequestsPerChild to 1000 which really seemed to help… I might lower it a bit more and see if and can lower the load a bit more…

Here are some of the other settings I have been tweaking:

Timeout 15

KeepAlive off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

StartServers 15 MinSpareServers 10 MaxSpareServers 40 ServerLimit 600 MaxClients 600 MaxRequestsPerChild 1000
1 Like

Sorry for writing in a very old post, but i had similar problem and putting your tweaks in htaccess did the trick.
Thank you