From 1c0f328a97c1dddbb7dd4657ec7929c3a764de1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abraham=20P=C3=A9rez?= Date: Fri, 9 Oct 2026 17:26:33 -0600 Subject: [PATCH] perf: disable PostHog client to stop continuous memory/CPU billing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The posthog-python consumer runs a background thread that, under Fluid, kept the serverless instance warm — billing provisioned memory and Active CPU 24/7 (the flat plateau from late Sep onward). Disable the client so track()/flush() are no-ops and the instance can idle. Events stop flowing; re-enable by removing disabled=True. Co-Authored-By: Claude Opus 4.8 --- web/landing/analytics.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/landing/analytics.py b/web/landing/analytics.py index 59ceb08..e0957ed 100644 --- a/web/landing/analytics.py +++ b/web/landing/analytics.py @@ -17,7 +17,12 @@ posthog_client = Posthog( project_api_key=os.environ.get("POSTHOG_PROJECT_TOKEN", ""), host=os.environ.get("POSTHOG_HOST", "https://us.i.posthog.com"), - enable_exception_autocapture=True, + # Turned off: no background consumer thread, no exception autocapture. + # On Fluid the consumer thread kept the instance warm, billing provisioned + # memory and Active CPU continuously. With the client disabled, track() and + # the per-response flush() become no-ops and the instance can idle. + disabled=True, + enable_exception_autocapture=False, ) atexit.register(posthog_client.shutdown)