Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5706

Matomo makes website very slow once per hour

$
0
0

@ygramoel wrote:

I am managing the website embeetle.com and I recently installed Matomo (self-hosted). Since then, the website reacts very slowly from time to time, with loading times of multiple seconds up to 60 seconds and the browser showing it is waiting for Matomo. Normally, the website home page loads in less than a second.

The website currently has very few visitors (a few per day) but I expect that to change soon, so it is important to get rid of this delay. In an attempt to figure out what is wrong, I wrote a script that downloads (using wget) the website’s home page and also does the same http request as the javascript code for Matomo. The home page always loads fast, but the Matomo request is very slow just once per hour. Other requests are fast. My conclusion is that the problem is not my server, but something in the Matomo code.

Except for this hourly delay, Matomo seems to work well.

I have no clue how to continue debugging this issue, so I am looking for suggestions.

I am running Matomo 3.13.0. The server is a VPS running Ubuntu with Nginx.

This is the Matomo code in the head section of the embeetle home page:

<script type="text/javascript">
  var _paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(["setDomains", ["*.embeetle.com"]]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  _paq.push(['enableHeartBeatTimer']);
  (function() {
  var u="//matomo.embeetle.com/";
  _paq.push(['setTrackerUrl', u+'matomo.php']);
  _paq.push(['setSiteId', '1']);
  var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
  g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Matomo Code -->

And this is the script I use for testing:

#!/bin/sh
mkdir -p ~/work/matomo-test
cd ~/work/matomo-test

while true; do
etime=({ /usr/bin/time -f '%e' wget 'https://embeetle.com' -a embeetle.log; } 2>&1) mtime=({ /usr/bin/time -f ‘%e’ wget ‘https://matomo.embeetle.com/matomo.php?action_name=Embeetle%20IDE&idsite=1&rec=1&r=506807&h=12&m=12&s=52&url=https%3A%2F%2Fembeetle.com%2F&_id=f8c7680a866091c6&_idts=1572725488&_idvc=26&_idn=0&_refts=1574593973&_viewts=1574593973&_ref=https%3A%2F%2Fembedoffice.com%2F&send_image=1&pdf=0&qt=0&realp=0&wma=0&dir=0&fla=1&java=0&gears=0&ag=0&cookie=1&res=1680x1050&gt_ms=165&pv_id=7O7vI4’ -O matomo.gif -a matomo.log; } 2>&1)
echo “$(date) $etime $mtime” | tee -a test.log
sleep 300
done

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5706

Trending Articles