Matomo Performance (Page Speed)

Hi,

My website is extremely fast. It takes between 300-500 ms to fully load. Anyway, I have installed Matomo on my blog today.

The piwik.js is loading fast but the piwik.php always takes 360 ms to load (see below). Is it usual?
I’m using Cloudflare CDN.

Thank you,
Best regards.

Hi,

It depends on how fast your Matomo server is. Keep in mind that this shouldn’t slow down your website as it is loaded asynchronously and deferred, so only after the user can interact with the website.

If this is still bugging you and you want to get it down to <30ms you can take a look at the Queued Tracking - Matomo Plugins Marketplace plugin. It makes the piwik.php only store the raw request in MySQL or Redis (which is faster) and then asynchronously handles the requests once the query is longer than x.

1 Like

360ms is definitely to long, a normal pageview should maybe take 20-60ms depending on your server. Are you sending more than the default parameters with your tracking script?

1 Like

I give Matomo second chance today. Response of piwik.php is still 300ms. I don’t have redis in the server. But I have memcached PECL module. Everything in my server is working blazing fast except piwik.php file.

Features of my server;

  • Nginx
  • PHP7.2-FPM
  • MariaDB
  • Memcached

My question is that, If I set a special cache rule for the piwik.php on Cloudflare, it helps me to reduce response time?

The special cache rule will be:
example.com/piwik.php* —> Cache Everything

Sorry, I’m noob about php.

You don’t need redis, you can also use the MySQL database for queued tracking.

Yes, it will strongly reduce the response time as the data will stop ending up in Matomo, but just be sent to cloudflare. So you would stop recording the user page views as they never reach Matomo.

1 Like

This is a core problem with Matomo and no solution until today.

We tested Matomo on a 32 Core dedicated machine and nothing got better.

Queued tracking do not change anything.

But please look to Matomo itself at https://gtmetrix.com/reports/www.innocraft.cloud/c8OyNfNV#waterfall

pwiki.php at 1.25 seconds, 340ms waiting for a image/gif and 200

Since our work is measured in 100ms blocks, currently Matomo is a kind of enemy.

We have a prototype of a proxy solution in pre-alpha stage, based on Cloudflare service workers, but we are not sure if we should follow this road.

1 Like

Same here. Matomo’s php script is awfully slow. I test it often at GTmetrix and others, and it has always around 1.3 secondsor more of delay. It is simply too much to slow down the landing page by almost 1.5 second.

@VK,

See here for more information:

Hi Lukas and thank you for your feedback.

Best case: we have a different understanding of http browser request handling and browser render behaviour and timing metrics.

In our organization every request which need more than 100ms is questionable and is subject of investigation.

Until today we fire matomo after the onload event, since from a browser render engine it’s to slow.

A solution could be a service worker on a edge server managing this, but I see this more as a core Matomo topic to solve.

Hi @Pak_Kriss,

As I showed above, it is quite easy to get Matomo requests below 100ms even on my simple VPS, so I don’t think more complicated solutions are needed.

Hi Lukas and thank you for your feedback.

Unluckily I would say, this is not the case, what you think. But maybe I’m totally wrong.

I refer to all official webpages operated by InnoCraft/Matomo.

Everywhere the same issue.

I’m happy to hear that’s not an issue in Western world networks, but I don’t have this environment.

Hi,

Have you already tested Queued Tracking - Matomo Plugins Marketplace ? It should give the most benefit by simply storing the raw request and then processing it asynchronously.

Hi Lukas, thank you for your reply. Queued Tracking is up and running since a while :slight_smile:

@Lukas @fdellwing @ViKol @Pak_Kriss Actually when I first created this thread, I was very beginner about web optimization. Now, I realized that, Google doesn’t care about when your page will completely be loaded. Instead, Google cares about “First contentful paint”, “Index speed”, “First byte time” and etc. for better SEO. It means how fast your page is rendered. Matomo files are already deferred and very ligthweigth. So piwik.php starts loading after the page load only. It has no affect on your webpage at all. You can simply ignore piwik.php.

2 Likes

I used the setup document.
Connected to the page The procedure does not work with a new authenticator. I do not know what to do…