Search Burst

Find answers, guides, features and more.

    Home – Guides – How to reduce tracking load on a busy WordPress site

    How to reduce tracking load on a busy WordPress site

    Self-hosting your analytics has clear advantages. You own your data, you decide when it’s deleted and in many countries you don’t need to ask for consent when the data is self-hosted and anonymous.

    The trade-off is that your own server does the work. Every pageview sends tracking requests, and normally each one writes to your database right away. At a few hundred visitors a day you won’t notice. When a newsletter goes out or a WooCommerce sale starts, those writes compete with your checkout for the same server.

    High-traffic buffer mode takes tracking out of that competition. This guide explains what the mode does, when you need it, how to turn it on and check it, and what you give up in return.

    The mode is part of the free Burst Statistics plugin and every Burst Pro plan, from version 3.7.5.

    What high-traffic buffer mode does

    Without the mode, Burst handles a tracking request on the spot: it opens a database connection, works out the session and writes the hit. With the mode on, that work is split in two.

    1. The tracking request adds one line to a file on your server. It doesn’t load WordPress and doesn’t connect to the database
    2. A background job reads that file about once a minute and stores the hits in batches of up to 1000

    Your data still ends up in your own WordPress database, in the same tables as before. Each hit keeps the time your server received it, so a visit from 14:03 stays a visit from 14:03, even if it’s stored a minute later.

    The mode reduces the load tracking puts on your server. It doesn’t make your database smaller or your Burst dashboard faster, and it won’t fix a site that’s slow for other reasons.

    Do you need it

    Burst tells you. Once the busiest hour of the past seven days reaches 3000 pageviews, a recommendation appears on your dashboard.

    That number is an estimate, not a measurement, and it’s on the cautious side. An hour averages out its busiest minutes, so 3000 pageviews an hour means peaks of about 75 to 100 pageviews a minute. Each pageview sends more than one tracking request: one when the page loads and another when the visitor leaves. On a shared hosting plan, that’s enough to notice.

    Turn it on sooner if your site slows down during campaigns or your host warns you about database load.

    Before you turn it on

    Your site needs to meet four conditions.

    • It’s a single WordPress site. Multisite isn’t supported.
    • WordPress can write to its root directory, because Burst creates a file called burst-buffer-config.php there
    • WordPress can write to the uploads directory, where the buffer file lives

    We also recommend to have a cron job run every minute or every 5 minutes. You can set it to lower frequencies, but if you have a cron job running every hour, your statistics data will also lag an hour.

    On multisite or with a root directory WordPress can’t write to, the setting is disabled.

    How to turn it on

    If you see the recommendation on your dashboard, click Enable in that message. Otherwise, use the setting:

    1. Go to Settings, then Advanced
    2. In the Scripts block, turn on High-traffic buffer mode
    3. Save your settings

    Then clear your page cache. Cached pages can keep sending hits to the old address until they’re rebuilt, and those hits go straight to the database.

    What changes in your dashboard

    This is the trade-off: your live numbers run behind. A hit only counts once the background job has stored it, which normally takes up to a minute if you have set a cron job each minute. That affects three places:

    • The live visitors number in the Today block
    • The list of live visitors, where new visitors and page changes appear later
    • The message that tells you how many people are exploring your site right now

    Burst counts someone as live for five minutes after their last activity. With a delay of 30 to 60 seconds, the live number comes out roughly 10 to 20 percent low on steady traffic. That’s a calculation from the time window, not a measurement. Read the number as an indication, not a head count.

    Your other reports catch up after each run. Yesterday’s numbers and last month’s numbers don’t change at all. During a large peak the job can fall behind, because a cron run stops after 45 seconds and the next one continues where it left off.

    What happens when something goes wrong

    The buffer is built to step aside. When a condition below applies, new hits go straight to the database, the same way they do without the mode, until the problem is gone.

    SituationWhat Burst does
    The background job hasn’t run for 10 minutesWrites new hits directly and shows a warning below the setting. Hits already in the buffer wait for the next run
    The config file in the root directory is missingWrites new hits directly and creates the file again on the next run
    The buffer folder can’t be written toWrites new hits directly
    The buffer folder holds more than 100 MBWrites new hits directly until the job has made room
    A batch can’t be storedTries again on the following runs. After three failed attempts it moves the batch to a .quarantine file, so the rest of your data keeps flowing

    If you find .quarantine files in the buffer folder, those hits weren’t stored. Burst removes these files after seven days while the mode is on, so look at them before then if you want to know what went wrong. Each entry includes the error.

    What’s in the buffer file

    The buffer holds what Burst needs to process a hit later, including the visitor’s IP address and browser details. Those stay on your own server, for about a minute until the job has handled them, or up to seven days in a quarantine file.

    The folder has a random name and, on Apache, an .htaccess file that blocks direct access. Nginx ignores .htaccess, so there the random name is the protection unless you add your own rule. If a backup tool copies your uploads directory, exclude this folder too.

    How to turn it off

    Turn off High-traffic buffer mode in Settings, Advanced and save. New hits go straight to the database again. The background job keeps running until the buffer is empty and then stops by itself. The recommendation won’t come back after you’ve used or dismissed it.

    Deactivating the plugin is different. Hits still in the buffer then wait on disk. To store them, activate Burst again and run wp burst process_buffer or turn the mode back on.

    Our advice

    If Burst recommends the mode and you don’t watch the live counter during a sale, turn it on. You give up a minute of freshness and keep more of your server free for the visitors who are buying something. If the live counter matters more to you and your server handles your peaks fine, leave it off. You can switch at any moment.

    Written by

    Co-founder of Burst Statistics