There may be scenarios where you may have a peak in traffic, during these times there may be many concurrent requests which in turn cause the database to quickly overloaded.

To ensure reliability for high traffic Matomo during peaks of traffic, it is critical to use our Queued Tracking plugin to store all incoming requests into a queue, to make it possible to process requests faster in bulk asynchronously.

Please follow these steps:

  1. Get QueuedTracking from the Marketplace
  2. Activate the QueuedTracking plugin in “Matomo Administration > Plugins “
  3. Under “Matomo Administration > System > General Settings > QueuedTracking”
  4. Select Backend = MySQL Select Number of Queue workers = 1
  5. Select Number of requests that are processed in one batch = 50
  6. Disable the setting Process during tracking request
  7. Then setup a cronjob that executes the command ./console queuedtracking:process every minute, for example:

     MAILTO=your-email@company.com
       #Process tracking requests from the queue
        1 * * * * php /path/to/matomo/console 
        queuedtracking:process --no-ansi >/dev/null 2>&1
    

Then to check this is working, you can keep track of the queue and see how big it is by executing the command:

    ./console queuedtracking:monitor

This will show the current state of the queue. In traffic peak time the queue will grow 1,000 or 10,000 requests or more, but usually the queue should be around 0-150 requests.

For any bug report or feature request, please post them in the plugin’s issue tracker.

Previous FAQ: How do I delete historical Matomo data? (data retention for old web analytics raw data logs and/or old processed reports)