Back to blog

How Can You Scale Piwik For High Traffic Websites?

Product best practices

Written by

Published December 8, 2016 · Updated August 3, 2018

How Can You Scale Piwik For High Traffic Websites?

The volume of traffic your website receives is really important when considering your web analytics platform performance. If you use a cloud-hosted solution, one rule of thumb is that the more visits your site records, the higher and more expensive plan you need to subscribe to. Things get a bit different if you use self-hosted tools like Piwik. Here’s a handful of hints from the PRO team to help you scale Piwik for high traffic websites and optimize your infrastructure and platform settings for best results.

With frequent improvements and releases, Piwik can now scale by default to efficiently track thousands of websites ‘out of the box’. This is especially useful for enterprises and web agencies serving large numbers of clients.

The Piwik PRO team has helped gear up infrastructure and set up software for organizations recording as many as 1 billion actions a month. Here’s some advice and hints to help you on the way to making Piwik work smoothly on your high-traffic websites.

Optimize Piwik’s Performance Issues: A Free Guide

Learn how to boost Piwik’s reporting speed and strengthen web analytics data security:

Download FREE Guide

Scale Piwik For High Traffic Websites: The Tenets

Let’s be honest, we’re not going to get anywhere without proper infrastructure preparation. If you want to achieve optimal Piwik performance, your host should come with the following things:

  • Web Server such as Nginx
  • PHP version 5.6 or greater
  • MySQL version 5.6 or greater with InnoDB engine or MariaDB 10 + TokuDB.

Piwik supports and works fine with older versions of MySQL and PHP, but for optimal results it’s best to go for at least PHP 5.6 because it is much more memory-efficient.

Server Configuration Thresholds

Your server configuration details will depend on the volume of traffic your website receives. As a rule of thumb, check which traffic threshold your website falls into and follow these guidelines:

  • Up to 1k actions per day / less than 30k per month:
    No action required, as Piwik analytics works well even with the cheapest hosting.
  • Up to 10k actions per day / less less than 300k per month:
    To ensure optimal Piwik performance, look for fast-shared hosting and virtual servers.
  • Up to 100k actions per day / more than 3 million per month:
    You may want to look for a virtual server or dedicated hosting, such as Piwik PRO Cloud or On-Premises.

For higher numbers it is essential to prepare a cluster of servers. The Piwik PRO Team recommends that this kind of cluster should include:

  • two frontends
  • separate archiving server
  • two DBs with master-master replication.

Don’t Forget Your Database!

The MySQL database in Piwik can very quickly grow to large dimensions. It typically requires around 1GB of storage per 5 million page views. So if you’re tracking around 100k actions a day, that equates to 36 million per year and a database size in excess of 7GB.

You can improve Piwik’s performance by tuning your MySQL database correctly for maximum performance. Tools such as MySQL tuner and Percona toolkit are great forhttps: optimizing your database to enhance output.

As a rule of thumb, it’s good to use MySQL’s InnoDB tables as they can be tuned within the MySQL settings. You can find a lot of useful tips on the website, including advice on optimizing InnoDB I/O performance, which you can do by tables compression, for instance.

If you are a heavy user who receives hundreds of millions monthly actions, the PRO Team recommends considering a cloud-hosted database. There are many providers to choose from, and for some of the top picks you can check out this post by Brandon Butler of Networked World.

At Piwik PRO we are big fans of the AWS offering for its capacity to offer instant and fluent scaling of cluster components. (No, this is not an advertorial or sponsored product placement ;).

Depending on your database needs, AWS will suggest the best product and solution type.
Depending on your database needs, AWS will suggest the best product and solution type.

Instead of conclusion

The more traffic your websites receive, the better for your business! But make sure your infrastructure is ready to handle it. We hope that the things we’ve outlined in the text will be a good starting point on your path to scale Piwik for high traffic websites. For a more detailed discussion you can download our whitepaper on optimizing Piwik for top performance.

For a little extra help you could also enlist Piwik PRO consultants to support you with configuring your server to boost infrastructure performance by tweaking and customizing your setup. Drop us a line and we’ll get the ball rolling!


Ewa Bałazińska

See more posts of this author