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.
AI Generated with Qwen 3.0 via CometAPIWhy 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.
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/sTwo rules govern sizing:
- 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.
- 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
| Dimension | Configuration |
|---|---|
| Host | 8 vCPU (dedicated), 32 GB RAM, NVMe, Linux 6.8, Docker 26 |
| Split stacks | ClickHouse 24.x: 4 vCPU / 16 GB; Postgres 16: 2 vCPU / 4 GB |
| Load generator | Custom Go harness (below), 512 workers, open-loop pacing |
| Latency capture | HdrHistogram, µs resolution, drained response bodies |
| Workload realism | 12,400 distinct paths, 3,100 referrers, 41 UTM tuples, 6 UA families, 4.3% bot-mixed traffic |
| Runs | 3 × 30 min per engine per rate tier; medians reported |
| Tier | Ramp 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)
| Engine | p50 | p95 | p99 | p99.9 | Max sustainable ev/s (p99 < 100 ms) | Failure mode at saturation |
|---|---|---|---|---|---|---|
| Plausible CE | 1.1 ms | 3.9 ms | 18 ms | 95 ms | ~9,500 | Insert queue backpressure; buffered 202s, occasional 5xx on flush timeout |
| Umami 2.x | 4.2 ms | 11 ms | 34 ms | 410 ms | ~2,600 | Prisma connection pool exhaustion → 502s, then cascading timeouts |
| Matomo 5.x | 9.6 ms | 38 ms | 121 ms | 1,400 ms | ~1,100 | InnoDB row-lock contention + PHP-FPM worker saturation; archiving overlap doubles p99 |
| GoatCounter | 1.8 ms | 4.1 ms | 9.7 ms | 340 ms | ~450 | SQLite 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) | Plausible | Umami | Matomo | GoatCounter |
|---|---|---|---|---|
| Unique visitors | 41 ms | 1,940 ms | 220 ms (archived) / 9.4 s (live) | 12,600 ms |
| Top pages + uniques | 88 ms | 2,610 ms | 310 ms / 11 s | 18,400 ms |
| Referrer breakdown | 62 ms | 2,050 ms | 260 ms / 7.8 s | 9,100 ms |
| Session duration p50 | 130 ms | 3,900 ms | 480 ms | timeout |
| Custom event segmentation | 74 ms | 4,400 ms | 1.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
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:
| Stack | Infra $/mo | Ops h/mo | Infra $/1M | Total $/1M |
|---|---|---|---|---|
| Plausible CE (+ClickHouse) | ~$180 | 5 | $0.18 | $0.78 |
| Umami + partitioned Postgres | ~$85 | 7 | $0.09 | $0.92 |
| Matomo + tuned MySQL + Redis | ~$250 | 14 | $0.25 | $1.93 |
| GoatCounter | ~$24 | 1 | $0.02 | N/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
# 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
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
-- 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
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
# /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; 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[] = redisOperational 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
insertbatching, 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 reality | Choose | Why |
|---|---|---|
| < 5M events/mo, one VPS | GoatCounter | Best latency-per-dollar; zero ops; SQLite is a feature here |
| 5–80M events/mo, product team | Umami | Postgres skills already in-house; JS SDK is trivial |
| Need funnels, segments, marketing attribution | Matomo | Only stack with mature segmentation and archiving |
| ≥ 500M events/mo, privacy-first, low ops | Plausible CE + ClickHouse | Columnar compression + HLL sketches keep dashboards < 100 ms |
| You value your weekends | None of the above — buy managed | At $0.78–$1.93/1M true cost, hosted wins past ~100M/mo |
Sources & Technical References
- Plausible Analytics — official self-hosting documentation: https://plausible.io/docs/self-hosting
- Plausible — ClickHouse integration and configuration: https://plausible.io/docs/self-hosting-configuration
- ClickHouse —
uniqCombined/uniqCombined64approximate aggregation reference: https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/uniqcombined - ClickHouse — MergeTree engine and data-part management: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree
- Matomo — developer and administration documentation: https://developer.matomo.org/
- Matomo — archive script and
core:archivereference: https://developer.matomo.org/guides/cron-archiving - Umami — official documentation and self-hosting guide: https://umami.is/docs
- GoatCounter — official help and self-hosting notes: https://www.goatcounter.com/help
- PostgreSQL 16 — table partitioning (range partitioning, pruning): https://www.postgresql.org/docs/16/ddl-partitioning.html
- RFC 9110 — HTTP Semantics, §15.3.3
202 Accepted: https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.3 - MDN —
navigator.sendBeacon()and page-unload event delivery: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon - W3C — Navigation Timing Level 2 (client-side latency measurement): https://www.w3.org/TR/navigation-timing-2/
- HdrHistogram — high-dynamic-range latency capture methodology: https://github.com/HdrHistogram/HdrHistogram
- Little, J.D.C. (1961), "A Proof for the Queuing Formula: L = λW", Operations Research 9(3): https://doi.org/10.1287/opre.9.3.383
- Dean, J. & Barroso, L.A. (2013), "The Tail at Scale", Communications of the ACM 56(2): https://doi.org/10.1145/2408776.2408794
Discussion (0)
Continue Reading
More production-grade engineering deep dives and architectural guides

Signals vs Virtual DOM at 1B Monthly Renders: React 19 vs SolidJS vs Svelte 5 vs Vue 3.5 — Measured p99 Frame Time, Memory, Bundle Size, and True Cost per 1M Updates
We rebuilt the same 10,000-row update workload in React 19, SolidJS, Svelte 5, and Vue 3.5 and measured p99 frame time, retained heap, bundle weight, and a defensible cost model per million updates. The numbers show that architecture, not micro-optimization, decides whether your tail latency survives a billion renders.

Postgres Egress Cost Optimization: Cutting Network Bandwidth by 70% in High-Throughput APIs
Your Postgres bill is rarely about CPU — it is about bytes leaving the database, crossing an availability zone, and traversing a NAT gateway. Here is the systematic playbook we used to cut data transfer cost by 70% in a high-throughput API without touching query latency.

Gemini 4 Neon: A Principal Engineer's Deep Dive into the Architecture
Gemini 4 Neon is a serving-systems release disguised as a model launch: the interesting engineering lives in its control plane, cache fabric, and streaming transport, not the benchmark table. This analysis breaks down the four-plane topology, the latency budget you must own, and the production patterns that keep a Neon integration from melting down under load.