I have been experiencing Matomo being extremely slow, making it completely unusable.
Dashboard login screen takes ~30 seconds just to render
Dashboard login usually times out
Tracking requests takes ~8 seconds
Environment:
Matomo 3.9.1
OpenBSD 6.5
PHP 7.2.17 (tested both through mod_php and FPM)
Apache 2.4.39
MariaDB 10.0.38
This server has barely any load, others sites on this server run just fine.
What I have tried so far:
Ran core:archive from console
Ran diagnostics:run, it warned about some folder permissions, I fixed that
Clean reinstall of Matomo
Reload of webserver
There is nothing in the Apache logs except the occasional timeout (php runtime exceeds my limit of 30 seconds).
I expect this to be some restriction caused by OpenBSD (by default php config is very restricted on OpenBSD). But I have no idea how to debug Matomo and find out what is causing the slow response.
Can anyone help me with some tips on how to debug this?
I (temporarily) raised the timeout to 120 seconds, which allowed the script to finish. This sped up Matomo a bit, but it’s still not really usable. The widgets in the dashboard take about 10 seconds each to load.
I disabled the internet features like you suggested, but that doesn’t make a difference
I’d prefer not having to install and run xdebug on a production server, so is there anything else I can check before having to resort to a debugger?
When running diagnostics:run from the console, I noticed this:
Unable to test if mod_pagespeed is enabled: the request to http://unknown/var/mysite/stats/matomo/console?module=Installation&action=getEmptyPageForSystemCheck failed
Notice that Matomo it is trying to fetch http://unknown.
I didn’t notice this before, because it is displayed as a green INFO line so I skipped over it while checking the output of the diagnostics.
I suspected that maybe there was some issue with Matomo in OpenBSD as I think noone in the team has tested it yet.
As I have never used any BSD os before, I just installed it in a vm and tried to set up Matomo (everything should be the same version as for you, but I used the default httpd)
While some features aren’t working as I haven’t installed the needed PHP modules (curl and gd), Matomo works fine and loads really quickly.
Tracking requests taking 8-10s is very unusual. The only thing i can think of is, are you using some sort of slow NFS disks or other network mounted disks? just make sure all Matomo files are not on NFS ever.
We have Matomo installed on a modern Xeon machine with SSD storage, the machine is virtual but we haven’t had any performance issues with storage. The machine runs other services (with the same php/apache/mysql setup) and they all perform like expected. So I have no indication the performance issues are due to hardware or storage.
I’m experimenting with various PHP and Apache settings to see if that makes any difference. If I find something I’ll make sure to share that here.
Was there a solution to this issue? I am having similar problems currently, well they actually sound exactly like what @LeonM wrote about. Also if I am looking in the wrong place please draw me a map.