Slow widgets


#1

I installed piwik two days ago on a site with 300 visitors each day. the widgets are very slow. It costs 5 minutes to populate them all. At the web server I see a php process for each outstanding widget, which is removed after the widget gets populated.
I switched of auto-archiving as described in How to setup auto archiving of your reports without any effect for the performance.

Is there a way to debug it?


(Matthieu Aubry) #2

In the Piwik admin UI, did you disable ‘enable browser to trigger auto archiving’ and did you set a high time to live eg. 3600 seconds ?


#3

yes I did. for each widget there resides a php-cgi process on the server. sometimes the number of process increases. only closing the web browser window helps to slowly decrease the number of (waiting) processes on the server. how can I debug what they are waiting for?


(Matthieu Aubry) #4

can you update to latest version of php? probably a php bug


#5

no! unfortunately this is not possible (but I asked our provider). is there a known bug for a specific version which causes slow widgets? I think it is a parallelity problem with the database because on the first call of the dashboard - one, two and sometimes three (changing) widgets are populated ad hoc. the others are waiting.


(Tony Cheung) #6

I’m running on a Debian Lenny VPS with 512mb of RAM allocated. It’s not that speedy and was wondering what people recommend as an optimal (without going crazy) RAM setup?


(vipsoft) #7

I think the issue you’re seeing is that the dashboard loads multiple widgets, and each widget generates a request to the server. With php-cgi, you’ll see multiple processes. Because each request begins with a session start (to synchronize access to session data), processes may be temporarily blocked. (This all happens within php.)

There are a couple of things we can do:

  1. modify Piwik to use a db-backed session store, perhaps removing the dependency on the built-in session extension; then use lazy init to start the session only when access to session data is req’d
  2. alternately, you could try php-fpm

Parallelizing requests comes with tradeoffs though. For example, you have to make sure you have more allowable mysql connections, more memory, etc.


(Tim) #8

Same problem here, but my friend fixed fast, so I’ll ask how to fix it, if you still need.


#9

Yes,I still Need a fix


#10

@vipsoft: This sounds like a good Analysis of my Situation. How can I modify piwik to use a db-backend Session Store?
I have to Look, what php-fpm is. This may take some days, because I am in Holiday. But thank you for your hints.


#11

@Tony Cheung: Is it the php config value ‘memory_limit’? It is set to 64mb in the installation of our Provider. If so, that could be the reason, why I went crazy.