Page 1 of 1

Piwik halts before loading is done [SOLVED]

Posted: 28 Aug 2011, 12:34
by totte
I'm wondering if anyone has successfully run the Piwik web analytics tool on their B3 (or B2)? I installed it and attempted to run it but once logged in the pages would stop loading halfway through (it worked just fine on my VPS though). It seems odd since the B3 is otherwise quite capable of running this and that. Could it be something else that's playing tricks on me?

Edit: Changed thread title to better reflect the issue - that was, see this post, specifically.

Re: Piwik on B3 - poor performance

Posted: 30 Aug 2011, 12:25
by Ubi
yes, could be

Re: Piwik on B3 - poor performance

Posted: 30 Aug 2011, 13:03
by DanielM
Ubi wrote:yes, could be
That is a constructive answer!

/Daniel

Re: Piwik on B3 - poor performance

Posted: 30 Aug 2011, 15:04
by Ubi
sorry, couldn't resist.
It's kinda irritating to see that unix-savy people (defined by the ability to install and activate a program such as desribed), when encountering a slight issue, can't be arsed to report the machine and network load, logfiles or anything at all to identify the problem themselves. Instead they run to the forum where they will be asked exactly these questions.

Thus, if you ask a question that completely lacks meaningful anchorpoints for help, you get a meaningless answer.

Re: Piwik on B3 - poor performance

Posted: 30 Aug 2011, 16:01
by totte
Ubi wrote:yes, could be
Ubi wrote:sorry, couldn't resist.
It's kinda irritating to see that unix-savy people (defined by the ability to install and activate a program such as desribed), when encountering a slight issue, can't be arsed to report the machine and network load, logfiles or anything at all to identify the problem themselves. Instead they run to the forum where they will be asked exactly these questions.

Thus, if you ask a question that completely lacks meaningful anchorpoints for help, you get a meaningless answer.
I'm aware of asking a vague question without attaching any logfiles or other relevant data. The reason is simply put that I don't consider myself UNIX-savvy (not on an administration level at least) and therefore have very few ideas on what logfiles or other debugging aids to check. I did search and skim through the Piwik documentation but couldn't find anything that seemed relevant - nor what logs to view.

I take it from your second post that machine and network load could be worth to have a look at. w gave/gives the following output:

Code: Select all

load average: 0.00, 0.01, 0.05
At some point I've seen a 0.2 but as far as I know it's never been above that. I'm not sure how to find out the network load - I do have iptraf installed but what should I look for?

Re: Piwik on B3 - poor performance

Posted: 31 Aug 2011, 14:34
by Ubi
My first try would be to find the URL of one of those images that refuses to load, and see if you can get this without trouble. Can you wget this URL locally from bubba if not from the windows client? How does the apache log behave when you do this? How does the real-time load behave (run "top" to find out).
Basically, split your problem into the smallest possible steps and test those under conditions which you fully control.

Re: Piwik on B3 - poor performance

Posted: 16 Sep 2011, 16:52
by pcrene
I use piwik with succes. B3 is handling the database
And i use the ipad app to read the info.
Never more than 30 sec for a page.

Rene

Re: Piwik on B3 - poor performance

Posted: 22 Sep 2011, 16:09
by totte
Pardon the delay, got to check my e-mail spam folder more often...

Alright, running top shows that the user www-data running apache2 takes 72-98 % of the CPU whenever I click a link. I also get these JavaScript errors:

Code: Select all

SyntaxError: Unexpected identifier [mywebsiteurl/piwik/index.php?module=Proxy&action=getJs&cb=f137110b795e7ee4efec72e0d265dab7:2]
ReferenceError: $ is not defined [mywebsiteurl/piwik/index.php?module=CoreHome&action=showInContext&idSite=1&period=day&date=today&moduleToLoad=Dashboard&actionToLoad=embeddedIndex&module=CoreHome&action=showInContext:119]
ReferenceError: $ is not defined [mywebsiteurl/piwik/index.php?module=CoreHome&action=showInContext&idSite=1&period=day&date=today&moduleToLoad=Dashboard&actionToLoad=embeddedIndex&module=CoreHome&action=showInContext:246]
ReferenceError: broadcast is not defined [mywebsiteurl/piwik/index.php?module=CoreHome&action=showInContext&idSite=1&period=day&date=today&moduleToLoad=Dashboard&actionToLoad=embeddedIndex&module=CoreHome&action=showInContext:1]
I'll do some more troubleshooting tomorrow, got to catch some sleep now.

Re: Piwik on B3 - poor performance

Posted: 29 Sep 2011, 07:54
by totte
/var/log/apache2/error.log output:

Code: Select all

[Fri Sep 23 10:44:56 2011] [error] [client xyz.xyz.xyz.xyz] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /xyz/www/piwik/libs/jsmin/jsmin.php on line 141, referer: http://www.xyz.com/piwik/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday
This points to the following with the specific line in bold:

Code: Select all

protected function get() {
    $c = $this->lookAhead;
    $this->lookAhead = null;
    if ($c === null) {
        if ($this->inputIndex < $this->inputLength) {
            [b]$c = substr($this->input, $this->inputIndex, 1);[/b]
            $this->inputIndex += 1;
        } else {
            $c = null;
        }
    }
    if ($c === "\r") {
        return "\n";
    }
    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
        return $c;
    }
    return ' ';
}
This is some sort of "JavaScript Minifier" and it's taking too long which, due to my server having a max_execution limit, results in the above errors. I added

Code: Select all

[Debug]
disable_merged_assets = 1
which is normally used for debugging in my config/config.ini.php and everything runs smoothly now. It's not pretty but it works...

Re: Piwik on B3 - poor performance

Posted: 03 Oct 2011, 20:36
by totte
Whoah this seems so silly in retrospect. I didn't have a clue what to ask for really - but in case anyone stumbles across this thread having a similar issue the solution (for me) was to increase the time limit on the server temporarily to let the minifier script run and then set the time limit back to normal. It's a startup thing.