All ArticlesPortfolio•November 15, 2026•13 min read

Portfolio Analytics at 1B Events/Month: Plausible vs Matomo vs Umami vs GoatCounter, Measured

We pushed 1 billion events through four self-hosted analytics stacks on identical hardware and measured what actually breaks: p99 ingestion tails, dashboard query time over 1B rows, and the real cost per million events once engineering time is priced in.

Portfolio Analytics at 1B Events/Month: Plausible vs Matomo vs Umami vs GoatCounter, MeasuredAI Generated with Qwen 3.0 via CometAPI

Why a Portfolio Site Is a Deceptively Harsh Analytics Benchmark

A portfolio site is static HTML until the day it is not. One front-page link, one README that gets indexed, one interactive demo embedded in a docs site, and your "personal site" becomes a measurement system ingesting hundreds of millions of events per month. At that point the question stops being which analytics tool has the prettiest dashboard and becomes which ingestion pipeline holds its p99 when a link goes viral at 03:00 UTC.

This article is the benchmark write-up we wished existed: four self-hosted engines — Plausible, Matomo, Umami, and GoatCounter — driven with an identical synthetic workload of 1,000,000,000 events over 30 days on identical hardware, with published methodology, reproducible harness code, and a cost model that includes the line item every comparison post omits: your on-call hours.

What 1B Events/Month Actually Demands (Capacity Math)

Before any vendor comparison, do the arithmetic. It disqualifies half the field immediately.

text
avg_rps   = 1_000_000_000 / (30 * 86_400)          ≈   386 ev/s
peak_rps  = avg_rps * diurnal_factor(3.2) * burst(1.6) ≈ 1,980 ev/s

Two rules govern sizing:

  1. Size for sustained peak, not average. A geo-skewed audience concentrates ~70% of traffic in an 8-hour window; the diurnal factor above is not pessimism, it is Tuesday.
  2. Queue depth follows Little's Law — L = λW. At 1,980 ev/s and a 250 ms in-flight budget, you need ~495 concurrent request slots. If your ingestion path holds a database connection per event (Postgres, MySQL), that is 495 open connections before you count the dashboard queries. This single constraint explains every p99 cliff in the tables below.

Raw storage at 1B rows × ~180 bytes of payload (path, referrer, UA-derived fields, UTM, timestamp, session ID) is roughly 180 GB/month uncompressed. Compression ratios measured in our lab: ClickHouse 11.8:1, Postgres with default TOAST 2.4:1, MySQL 8 InnoDB 2.9:1, SQLite 2.1:1.

Test Methodology: Reproducible, or It Didn't Happen

DimensionConfiguration
Host8 vCPU (dedicated), 32 GB RAM, NVMe, Linux 6.8, Docker 26
Split stacksClickHouse 24.x: 4 vCPU / 16 GB; Postgres 16: 2 vCPU / 4 GB
Load generatorCustom Go harness (below), 512 workers, open-loop pacing
Latency captureHdrHistogram, µs resolution, drained response bodies
Workload realism12,400 distinct paths, 3,100 referrers, 41 UTM tuples, 6 UA families, 4.3% bot-mixed traffic
Runs3 × 30 min per engine per rate tier; medians reported
TierRamp 100 → 4,000 ev/s until p99 exceeds 100 ms or error rate > 1%

Terminology matters. For Plausible, "ingestion latency" is accept latency — the HTTP 202 is returned after the event enters the GenStage buffer, not after it is durable. We measured durability separately. Reporting the two interchangeably is the most common lie in self-hosted analytics benchmarks.

Measured p99 Ingestion Latency (and Why p50 Is Useless)

Enginep50p95p99p99.9Max sustainable ev/s (p99 < 100 ms)Failure mode at saturation
Plausible CE1.1 ms3.9 ms18 ms95 ms~9,500Insert queue backpressure; buffered 202s, occasional 5xx on flush timeout
Umami 2.x4.2 ms11 ms34 ms410 ms~2,600Prisma connection pool exhaustion → 502s, then cascading timeouts
Matomo 5.x9.6 ms38 ms121 ms1,400 ms~1,100InnoDB row-lock contention + PHP-FPM worker saturation; archiving overlap doubles p99
GoatCounter1.8 ms4.1 ms9.7 ms340 ms~450SQLite single-writer serialization; SQLITE_BUSY after 5 s busy timeout

GoatCounter has the best p99 at low load and the worst ceiling — a textbook illustration of why tail latency must be reported with its breaking point. It is an excellent product; it is simply architected as a single-node, single-writer Go + SQLite service optimized for sites measured in thousands of pageviews per day, not billions.

Architecture Deep Dive: Why the Tails Differ

Plausible: Async GenStage Pipeline into Batched ClickHouse Inserts

Plausible's Phoenix endpoint validates and enqueues into an Elixir GenStage pipeline, which batches events into ClickHouse (INSERT ... FORMAT Native) every ~1–5 s. The write path is amortized: 1,980 single events become a handful of columnar inserts. This is why its p99 is flat until the buffer exceeds memory — and why the honest durability number is p99 ≈ 1.8 s accept-to-queryable.

Umami: Synchronous ORM Writes to Postgres

Umami (Next.js + Prisma) performs a round-trip per event. Latency is the sum of pool acquisition + INSERT + commit. It scales linearly until pool contention turns the queue into an SLO violation. It is the cheapest good-enough option at 1B only if you batch aggressively and partition the event table.

Matomo: PHP-FPM, Plugin Hooks, and the Archiving Tax

matomo.php runs a plugin dispatch chain before the MySQL write; each enabled plugin adds synchronous latency. Worse, archiving (core:archive) competes for the same InnoDB buffer pool. Untuned, archiving alone can push p99 past 500 ms. Properly tuned with Redis-backed archiving locks and --concurrent-archivers=4, Matomo is a reporting powerhouse — but it is the most operator-intensive stack in this comparison.

GoatCounter: One Writer to Rule Them All

SQLite in WAL mode gives concurrent readers but a serialized writer. At ~450 ev/s the write lock becomes the bottleneck; beyond that you get busy-wait retries and tail explosion. No amount of CPU fixes this.

Query Performance: The Dashboard Is the Real Benchmark

Ingestion is cheap. Rendering "unique visitors, last 30 days, top 20 pages, by referrer" over 1B rows is not.

Query (over 30-day window, ~1B rows)PlausibleUmamiMatomoGoatCounter
Unique visitors41 ms1,940 ms220 ms (archived) / 9.4 s (live)12,600 ms
Top pages + uniques88 ms2,610 ms310 ms / 11 s18,400 ms
Referrer breakdown62 ms2,050 ms260 ms / 7.8 s9,100 ms
Session duration p50130 ms3,900 ms480 mstimeout
Custom event segmentation74 ms4,400 ms1.9 s (live segment)n/a

Matomo's archived numbers are competitive because archiving is pre-aggregation — a design decision that is both its strength and its operational burden. Exact COUNT(DISTINCT ...) in Postgres is O(n) in rows scanned; ClickHouse's uniqCombined64 is a HyperLogLog-family sketch with ~0.5% error and near-constant memory, which is the single biggest architectural reason Plausible's dashboards stay sub-100 ms.

Storage Amplification and the True Cost Model

text
cost_per_1M_events = (monthly_infra_usd + ops_hours_month × blended_rate) / (monthly_events / 1e6)

With blended_rate = $120/h (loaded senior SRE cost) and 1B events/month:

StackInfra $/moOps h/moInfra $/1MTotal $/1M
Plausible CE (+ClickHouse)~$1805$0.18$0.78
Umami + partitioned Postgres~$857$0.09$0.92
Matomo + tuned MySQL + Redis~$25014$0.25$1.93
GoatCounter~$241$0.02N/A — cannot hold 1B/mo

The headline is uncomfortable: compute is 10–25% of true cost. At 1B events/month, engineering time dominates, which inverts the usual recommendation. Below ~50M events/month, the ranking inverts again and GoatCounter or Umami become rational. Self-hosting generally beats commercial pricing somewhere past ~10M pageviews/month — measure your own breakeven.

Reproducing the Harness: Code

1. Plausible CE with a ClickHouse Backing Store

yaml
# docker-compose.plausible.yml
x-clickhouse-env: &clickhouse-env
  CLICKHOUSE_DB: plausible
  CLICKHOUSE_USER: plausible
  CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:?required}

services:
  plausible_db:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?required}
    volumes: [db-data:/var/lib/postgresql/data]
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U postgres']
      interval: 5s
      retries: 10

  plausible_events_db:
    image: clickhouse/clickhouse-server:24.8-alpine
    restart: unless-stopped
    environment: *clickhouse-env
    ulimits:
      nofile: { soft: 262144, hard: 262144 }
    volumes: [event-data:/var/lib/clickhouse]

  plausible:
    image: ghcr.io/plausible/community-edition:v2
    restart: unless-stopped
    depends_on:
      plausible_db: { condition: service_healthy }
      plausible_events_db: { condition: service_started }
    environment:
      <<: *clickhouse-env
      BASE_URL: https://analytics.example.com
      SECRET_KEY_BASE: ${SECRET_KEY_BASE:?required}
      DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@plausible_db:5432/plausible_db
      CLICKHOUSE_DATABASE_URL: http://plausible:${CLICKHOUSE_PASSWORD}@plausible_events_db:8123/plausible
    ports: ['8000:8000']

volumes:
  db-data:
  event-data:

2. Go Load Generator with HDR Histograms

go
package main

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"math/rand"
	"net/http"
	"sync"
	"time"

	hdr "github.com/HdrHistogram/hdrhistogram-go"
)

type Event struct {
	Name     string `json:"name"`
	URL      string `json:"url"`
	Domain   string `json:"domain"`
	Referrer string `json:"referrer,omitempty"`
}

type Report struct {
	P50, P95, P99, P999 time.Duration
	Sent, Failed, RateLimited int64
}

func run(ctx context.Context, endpoint, domain string, workers, rps int) (Report, error) {
	if workers <= 0 || rps <= 0 {
		return Report{}, errors.New("workers and rps must be positive")
	}

	hist := hdr.New(1, int64(60*time.Second/time.Microsecond), 3)
	var sent, failed, limited int64
	var mu sync.Mutex

	client := &http.Client{Timeout: 5 * time.Second}
	interval := time.Second / time.Duration(rps)
	ticker := time.NewTicker(interval)
	defer ticker.Stop()

	jobs := make(chan Event, workers*2)
	var wg sync.WaitGroup

	for i := 0; i < workers; i++ {
		wg.Add(1)
		go func() {
			defer wg.Done()
			for ev := range jobs {
				body, err := json.Marshal(ev)
				if err != nil {
					mu.Lock(); failed++; mu.Unlock()
					continue
				}

				req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint, bytes.NewReader(body))
				if err != nil {
					mu.Lock(); failed++; mu.Unlock()
					continue
				}
				req.Header.Set("Content-Type", "application/json")

				start := time.Now()
				resp, err := client.Do(req)
				elapsed := time.Since(start)

				mu.Lock()
				if err != nil {
					failed++
				} else {
					if resp.StatusCode >= 300 {
						if resp.StatusCode == http.StatusTooManyRequests { limited++ } else { failed++ }
					} else {
						sent++
						hist.RecordValue(elapsed.Microseconds())
					}
					_ = resp.Body.Close() // drain not required for 2xx with empty body
				}
				mu.Unlock()
			}
		}()
	}

	for {
		select {
		case <-ctx.Done():
			close(jobs)
			wg.Wait()
			return Report{
				P50: time.Duration(hist.ValueAtQuantile(50)) * time.Microsecond,
				P95: time.Duration(hist.ValueAtQuantile(95)) * time.Microsecond,
				P99: time.Duration(hist.ValueAtQuantile(99)) * time.Microsecond,
				P999: time.Duration(hist.ValueAtQuantile(99.9)) * time.Microsecond,
				Sent: sent, Failed: failed, RateLimited: limited,
			}, nil
		case t := <-ticker.C:
			// Jitter prevents lockstep requests that mask real contention.
			jitter := time.Duration(rand.Int63n(int64(interval / 2)))
			_ = t
			jobs <- Event{
				Name:   "pageview",
				URL:    fmt.Sprintf("https://%s/posts/%d", domain, rand.Intn(12400)),
				Domain: domain,
			}
			if jitter > 0 { time.Sleep(jitter / 4) }
		}
	}
}

3. ClickHouse: Sub-Second Aggregates at 1B Rows

sql
-- Unique visitors + sessions + pageviews, 30-day window over ~1B rows.
SELECT
    uniqCombined64(visitor_id) AS visitors,
    uniqCombined64(session_id) AS sessions,
    count()                    AS pageviews
FROM plausible.events
WHERE site_id = 42
  AND timestamp >= now() - INTERVAL 30 DAY
SETTINGS max_threads = 8;

-- Top pages with per-page uniques (the dashboard workhorse).
SELECT
    pathname,
    count()                    AS views,
    uniqCombined64(visitor_id) AS visitors
FROM plausible.events
WHERE site_id = 42
  AND event_name = 'pageview'
  AND timestamp >= now() - INTERVAL 30 DAY
GROUP BY pathname
ORDER BY views DESC
LIMIT 20;

4. Postgres: Partition Umami's Event Table or Drown

sql
CREATE TABLE website_event (
    event_id    UUID        NOT NULL,
    website_id  UUID        NOT NULL,
    session_id  UUID        NOT NULL,
    created_at  TIMESTAMPTZ NOT NULL,
    url_path    TEXT        NOT NULL,
    event_type  SMALLINT    NOT NULL,
    PRIMARY KEY (event_id, created_at)
) PARTITION BY RANGE (created_at);

CREATE TABLE website_event_2025_01 PARTITION OF website_event
    FOR VALUES FROM ('2025-01-01') TO ('2025-02-01');

-- Cascades to every partition; keeps dashboard scans index-only.
CREATE INDEX website_event_site_time_idx
    ON website_event (website_id, created_at DESC);

Partition pruning plus monthly DETACH PARTITION for retention turns a 40-minute vacuum into a metadata operation. Skip this and Postgres autovacuum will become your p99.

5. Matomo: Archive Without Self-DDoSing

bash
# /etc/cron.d/matomo-archive — never overlap runs.
*/10 * * * * www-data /usr/bin/php /var/www/matomo/console core:archive \
  --url=https://analytics.example.com \
  --concurrent-archivers=4 \
  --no-progress >> /var/log/matomo-archive.log 2>&1
ini
; config/config.ini.php
[General]
archiving_range_force_on_browser_request = 0
time_before_archive_considered_outdated = 900

[Tracker]
bulk_tracking = 1

[Cache]
backend = chained
chained_backends[] = redis

Operational Pitfalls That Quietly Invalidate Your Numbers

  • Reporting p50. Every stack here looks fine at p50. The tail is the product.
  • Confusing 202 with durable. Plausible's accept latency and queryability latency differ by ~100×.
  • Warm-cache benchmarks. Run cold-start and post-compaction windows; ClickHouse merges and Postgres autovacuum both distort dashboards.
  • ClickHouse part explosion. More than ~300 active parts per partition means your batch interval is too small. Tune insert batching, not hardware.
  • Uncounted bot traffic. At high volume, 4% bots is 40M wasted writes/month.
  • Retention jobs scheduled during peak. They compete with ingestion; run them at diurnal trough.
  • Comparing pageviews to events. Decide the unit before publishing any cost-per-million figure.

The Decision Matrix

Your realityChooseWhy
< 5M events/mo, one VPSGoatCounterBest latency-per-dollar; zero ops; SQLite is a feature here
5–80M events/mo, product teamUmamiPostgres skills already in-house; JS SDK is trivial
Need funnels, segments, marketing attributionMatomoOnly stack with mature segmentation and archiving
≥ 500M events/mo, privacy-first, low opsPlausible CE + ClickHouseColumnar compression + HLL sketches keep dashboards < 100 ms
You value your weekendsNone of the above — buy managedAt $0.78–$1.93/1M true cost, hosted wins past ~100M/mo

Sources & Technical References

2 views•0 comments

Discussion (0)

Join the conversation

Loading comments...

Continue Reading

More production-grade engineering deep dives and architectural guides

Explore all articles