Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added async queries

Blue Mouse2a6cfcb9031b
diff --git a/apps/selfhosted/src/common/integrations/clickhouse.ts b/apps/selfhosted/src/common/integrations/clickhouse.ts
index f67387be9..528e11b6d 100644
--- a/apps/selfhosted/src/common/integrations/clickhouse.ts
+++ b/apps/selfhosted/src/common/integrations/clickhouse.ts
@@ -15,6 +15,11 @@ const clickhouse = createClient({
output_format_json_quote_64bit_integers: 0,
enable_http_compression: 0,
log_queries: 0,
+
+ // Used for analytics & captcha stuff.
+ // https://clickhouse.com/docs/en/optimize/asynchronous-inserts
+ wait_for_async_insert: 0, // Return ACK (await) when row was added to the buffer, not flushed to the database
+ async_insert_busy_timeout_ms: 15000, // 15 seconds; this is how long the buffer will be kept before writing stuff into the database
},
})