Learn about Centmin Mod LEMP Stack today
Become a Member

Matomo on Centminmod

Discussion in 'Other Web Apps usage' started by deltahf, Jul 2, 2023.

Tags:
  1. deltahf

    deltahf Premium Member Premium Member

    562
    249
    43
    Jun 8, 2014
    Ratings:
    +459
    Local Time:
    6:58 AM
    With the official sunsetting of Google Analytics UA today, I have been exploring other options to use in addition to GA4.

    It looks like the best option for me will be the self-hosted version of Matomo running on Centminmod. I see there has been some discussion about Matomo here over the years, but now that UA is officially dead and gone, I thought there might be more people looking to run Matomo on Centminmod servers and wanted to create a thread here.

    Why Matomo?



    Matomo seems to be the most similar to UA, but it's also different. Specifically, it supports Custom Dimensions which I found to be extremely powerful in GA and are an essential feature for my next analytics software.


    I use them to sort traffic by page type, forums and sub-forums (you can use it to see which threads in which sub-forums get the most traffic), WordPress page categories, and WordPress authors. You can still do this in GA4, but the reporting system is so clunky it's not as useful.

    Another huge advantage for Matomo is the ability to import your old data from Google Analytics. I have been using GA from day one and have almost 18 years worth of data stored in it that I do not want to lose. This would be a good way to save it for future reference.

    Server Requirements



    I would prefer to use Matomo Cloud so I don't have to worry about scalability or hosting. However, my site serves ~3M page views monthly, and with Matomo Cloud that would cost me nearly $1,000 USD per month, which I cannot afford.

    Fortunately they offer a self-hosted version with plugins that you can buy with annual subscriptions you can purchase which which is more affordable.

    Matomo offers recommended server specifications for the self hosted option appear to be rather excessive:

    Of course, everyone here will be spoiled with Centminmod's high performance, but unless Matomo is doing a ton of data processing behind the scenes I cannot believe that it needs so much processing power for analytics software. Am I underestimating its demands here?

    For those of you already hosting Matomo, what are your server specs? How is performance?

    I have plenty of overhead and horsepower on my site's dedicated server to run Matomo, but I would prefer to run it on a separate machine. A lot of my site's pages are enhanced/protected by various caches and can sometimes receive flash crowds of traffic. If every one of those page views hits my analytics software, I would not want it to put any load on the primary site. I would rather the analytics server get overwhelmed and go down instead of the site itself.

    Your Thoughts?



    So, who here is running Matomo on Centminmod? Anyone have any issues or thoughts?
     
  2. eva2000

    eva2000 Administrator Staff Member

    50,479
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,089
    Local Time:
    8:58 PM
    Nginx 1.25.x
    MariaDB 10.x
    Thanks @deltahf for reminding us! Matomo was originally called Piwik Analytics and I did have a Piwik instance on Centmin Mod LEMP stack once upon a time but no longer. See my write up at https://community.centminmod.com/threads/piwik-analytics-centmin-mod-nginx-vhost-configuration.4455/.

    Might be worth revisiting Matomo - like the idea of importing old GA data :)

    No idea about Matomo cloud though - sounds very expensive!

    From what I remember for Piwik, yes more traffic = more data = more cpu/mem/disk resources needed to process that data and create reports and stuff.
     
  3. eva2000

    eva2000 Administrator Staff Member

    50,479
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,089
    Local Time:
    8:58 PM
    Nginx 1.25.x
    MariaDB 10.x
    @deltahf OVH currently have alot of discount deals for dedicated servers - a cheap Matomo server maybe? The OVH Eco range seem nice Eco dedicated servers for Aussies and for USA folks Eco dedicated servers

     
  4. eva2000

    eva2000 Administrator Staff Member

    50,479
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,089
    Local Time:
    8:58 PM
    Nginx 1.25.x
    MariaDB 10.x
    Some info for you

    Different features of Matomo use different system resources (CPU, memory, and disk). Here is a general outline:

    1. Data Collection (CPU, Network, Disk): When visitors come to your site, Matomo collects data by executing JavaScript code in the visitor's browser, which sends data back to the Matomo server. On the server side, these requests are relatively light, but they can add up with high traffic, increasing CPU and network load. The collected data is then written to the database, using disk I/O.

    2. Archiving (CPU, Memory, Disk): Matomo processes the collected data in a step called archiving. This is where it calculates all the metrics and reports. This process is CPU and memory intensive, and can also generate significant disk I/O as data is read from and written to the database. The frequency of the archiving process can be configured. More frequent archiving allows more up-to-date reports, but uses more resources.

    3. Real-Time Reporting (CPU, Memory): Matomo's real-time reports show what's happening on your site right now. These reports are more demanding because they require Matomo to constantly process recent data. The more visitors your site has, the harder your server will have to work to keep these reports up-to-date.

    4. Segmentation (CPU, Memory): Segments are a way to view your reports based on specific criteria. For example, you could create a segment for visitors from a particular country, or visitors who used a particular keyword. When you view a segmented report, Matomo has to process the data on-the-fly, which can be CPU and memory intensive, especially for large data sets.

    5. Data Retention (Disk): Matomo stores all its data in a MySQL/MariaDB database. The more data you retain, the more disk space you'll need. Matomo has settings to automatically delete old data, which can help manage disk usage.
     
  5. deltahf

    deltahf Premium Member Premium Member

    562
    249
    43
    Jun 8, 2014
    Ratings:
    +459
    Local Time:
    6:58 AM
    Oh, GREAT idea! :D I didn't realize their prices were so low. I was a little worried about a VPS being a little under powered but one of these configurations would give me a lot more bang for the buck. I'm not used to shopping in the lower end of the dedicated server market but something like this should be fine.

    Good stuff. I'm expecting it to be fairly memory and CPU intensive.

    I need to research to see if there is any indication how big the imported Google Analytics data would actually be. It could easily be hundreds or even terabytes of data...

    Here's what Phind (GPT-4) had to say. Looks like it could take a long time to import as you can only export roughly 4 months of data from Google at a time...

     
  6. eva2000

    eva2000 Administrator Staff Member

    50,479
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,089
    Local Time:
    8:58 PM
    Nginx 1.25.x
    MariaDB 10.x
    Yeah for you the important part might be disk size for MySQL database if you want to keep data for a long time. OVH servers 450GB NVMe raid 1 might not be enough?? You can always just test it on dedicated servers that charge hourly. There's CherryServers (affiliate link) that offer hourly billed dedicated servers to test disk usage for imports. More expensive for monthly for hourly billed, you wouldn't use the full month

    i.e.
    • AMD EPYC 7313P 16C/32T
    • 64GB ECC Registered memory
    • 2x1TB NVMe raid 0 for 2TB storage (for testing only)
    • 100GB backup storage
    • 3Gbp/s uplink
    • 100TB bandwidth
    • Chicago
    • Spot Server 0.294 USD/hr
    • Hourly 0.612 USD/hr = US$14.688/day
    • Monthly 357.48 USD/mo
    other cheaper servers from CherryServers too
     
  7. deltahf

    deltahf Premium Member Premium Member

    562
    249
    43
    Jun 8, 2014
    Ratings:
    +459
    Local Time:
    6:58 AM
    Do you have an affiliate code for OVH too?
     
  8. eva2000

    eva2000 Administrator Staff Member

    50,479
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,089
    Local Time:
    8:58 PM
    Nginx 1.25.x
    MariaDB 10.x
    OVH does not have an affiliate code as their prices sell themselves lol
     
  9. deltahf

    deltahf Premium Member Premium Member

    562
    249
    43
    Jun 8, 2014
    Ratings:
    +459
    Local Time:
    6:58 AM
    Found a lot of good info on this page about tuning Matomo performance:

    Configure Matomo for speed - Analytics Platform - Matomo

    I have around 1 billion page views in GA, so if those get imported that would be a MySQL database size of ~200GB with 10-12GB growth per year at current traffic levels.

    Now for the bad news, importing from GA can be tricky:

    It is also very slow due to Google Analytics API rate limiting, which cannot be bypassed, as discussed by Phind above:

    Running the Google Analytics import - Analytics Platform - Matomo

    In my case this means it could take several months to import data, and unless I'm willing to wait until that import completes, I can't start tracking new/current data in Matomo unless I start tracking it in a completely separate "profile"/"site". Wish I had started looking into this a while ago!
     
  10. eva2000

    eva2000 Administrator Staff Member

    50,479
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,089
    Local Time:
    8:58 PM
    Nginx 1.25.x
    MariaDB 10.x
    I'd separate imported GA analytics data from your site just makes things easier
     
  11. wmtech

    wmtech Active Member

    160
    43
    28
    Jul 22, 2017
    Ratings:
    +123
    Local Time:
    12:58 PM
    We use Matomo for several years for 15 of our sites.

    It is installed using CMM at a medium sized VPS (which is also several years old now) and runs without any problems.
     
  12. duderuud

    duderuud Active Member

    145
    50
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +115
    Local Time:
    12:58 PM
    1.23 x
    10.6
    I am using a cheap Hetzner CPX21 with Matomo for quite a while now for our big board.

    No real issues whatsoever. Only thing that happens from time to time is a directory permission issue after an upgrade but that is easily fixed. Very happy with Matomo!