Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Piwik halts before loading is done [SOLVED]

Got problems with your B2 or B3? Share and get helped!
Post Reply
totte
Posts: 5
Joined: 28 Aug 2011, 12:27

Piwik halts before loading is done [SOLVED]

Post 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.
Last edited by totte on 03 Oct 2011, 20:39, edited 1 time in total.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Piwik on B3 - poor performance

Post by Ubi »

yes, could be
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: Piwik on B3 - poor performance

Post by DanielM »

Ubi wrote:yes, could be
That is a constructive answer!

/Daniel
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Piwik on B3 - poor performance

Post 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.
totte
Posts: 5
Joined: 28 Aug 2011, 12:27

Re: Piwik on B3 - poor performance

Post 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?
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Piwik on B3 - poor performance

Post 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.
pcrene
Posts: 305
Joined: 17 May 2008, 15:49

Re: Piwik on B3 - poor performance

Post 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
B3 1T + B-Stor 2T, B2 1T as backup
40 users active....
Opensat4all.Com
totte
Posts: 5
Joined: 28 Aug 2011, 12:27

Re: Piwik on B3 - poor performance

Post 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.
totte
Posts: 5
Joined: 28 Aug 2011, 12:27

Re: Piwik on B3 - poor performance

Post 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...
totte
Posts: 5
Joined: 28 Aug 2011, 12:27

Re: Piwik on B3 - poor performance

Post 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.
Post Reply