Performance & high traffic
Measured overhead is 0.4–0.6 ms per request (median, 100 models loaded, without persisting), and memory stays flat for a command that updates 10,000 records.
How it stays cheap
- Nothing is written in the middle of a request. Entries are persisted in the terminating phase, after the response was sent.
- Model changes are buffered and flushed every
buffer_sizechanges, so long imports don't grow in memory. - Retrieved models are stored as
class => idswith at mostmax_ids_per_modelids. - State is scoped per lifecycle, so it does not leak between requests on Octane or between jobs on a worker.
Tuning for high traffic
- Queue persistence —
AUDITOR_QUEUE=true(and a dedicated queue withAUDITOR_QUEUE_NAME). The request only dispatches a small job. - Sampling —
http.sample_rate = 0.1keeps 10% of plain requests; entries with changes or denied abilities are always kept. - A separate database connection —
AUDITOR_DB_CONNECTION. - Retention — schedule
auditor:prunewith a sensibleAUDITOR_KEEP_DAYS. - Turn off what you don't need —
models.track_retrieved,listeners.*,jobs.enabled,console.enabled. - Partitioning — on very large tables, partition
auditor_entriesandauditor_model_changesbycreated_atrange in your own migration.
The entries list uses cursor pagination, so it stays fast on millions of rows.