Lago relies a lot on Postgres. If you’re hosting your own instance, you must ensure Postgres is correctly configured. First, we recommend installing PgHero and keeping an eye on slow queries: https://github.com/ankane/pghero.Documentation Index
Fetch the complete documentation index at: https://docs.getlago.com/llms.txt
Use this file to discover all available pages before exploring further.
ANALYZE and VACUUM
Postgres needs to analyze and vacuum regularly for optimal performance.
Postgres can do it automatically for you. Make sure the autovacuum_analyze_scale_factor
and autovacuum_vacuum_scale_factor are set to a sensible value. We recommend 0.1 by default,
but it depends on the size of your tables.
events, invoices, charges and fees.
Configure custom override values for these tables.
For example, the events table should use a value lower than 0.01.
Because this factor is a ratio, it’s expected to lower it from time to time as your table size grows.
The most important table to monitor is
events. Depending on your implementation, this table can receive big
bursts of data and should be analyzed and vacuumed often.When to run manually
If you send events in batch, it’s recommended to analyze and vacuum yourevents table after the batch is ingested: