If you have thousands of page views per day or more, check out the guide below to make sure Piwik works for you.
Configure Piwik for speed
Configure your server for speed
Use case: a Piwik user reported to us tracking 6.5 Million pages in March 2013, with PHP having only 512M of memory.
The following recommendations help configure a server for maximum speed:
- Hosting Piwik on a powerful dedicated server is recommended when tracking high traffic websites.
- Piwik (php/Mysql) will benefit from significant RAM memory on the server: 1Gb memory being the minimum recommended for Piwik to process reports on very large websites, the more RAM the better!
- It is critical to use a PHP cache for high performance, we recommend using APC.
- It is recommended to use light web servers such as Nginx or lighttpd which can be faster and more efficient alternatives to Apache or IIS
- Piwik performance are heavily tied to Mysql Server performance as all Piwik data is stored and aggregated using Mysql queries. We recommend to use Mysql Tuning Primer or Mysql Tuner tools which will suggest optimal Mysql settings.
Configure Tracking for speed
- A rough estimate of Piwik Mysql database size usage is approximately 1Gb for every 5M page views. If your website tracks 100k page views per day (3M pages per month), you can expect a DB size of ~ 7Gb after 1 year.
An important factor for achieving good performance is to keep the number of unique URLs tracked low. Please make sure you setup ignored URL parameters you do not wish to count in the URL (such as session ID parameters). The less unique URLs tracked in Piwik the better!
- If you have limited database space, it may help to delete old logs, for example visitor logs older than 6 months. It helps keep the database size more manageable.
- By default Piwik detects the Internet provider by doing a reverse DNS lookup, which adds a few milliseconds overhead. If you want to track your visitors’ ISPs it will be faster to use either MaxMind’s ISP or Organization. Using the Organization database will also give you more information. Read more about installing them here.
- For advanced users, you can setup Piwik to work in a load balanced environment and use multiple servers behind a load balancer.
- In your config/config.ini.php, check that under [database] you find adapter=PDO_MYSQL rather than adapter=MYSQLI which can be slower. If the line adapter= is not found, you are successfully the default PDO_MYSQL
- If your website tracks 100M+ pages per month), Piwik might start reaching php memory limits or other mysql or hardware limitations. There have also been a few Piwik users tracking more than a billion pageviews over several months.
This guide was written by Piwik Professional Services – contact us for any advice or problem: we will make sure you make the most of Piwik.