brotli rob
29 posts


excited and humbled to announce that I started a new role as junior software engineer - posthog code mobile app
PostHog@posthog
Yes I do need to be on my phone right now No you can't look
English
brotli rob retweetledi

@IanVanagas @posthog and if you want to see what we've done post-rewrite to tune the system as the scale hit the projected numbers, check out this post from one of my teammates! posthog.com/blog/untanglin…
English

Feature flags are high stakes.
An outage affects not only our customers, but our customer's customers. When flags are slow, our customer's entire application slows down. Unreliability doesn't just make us look bad, but our customers too.
Our team at @posthog has done a lot to make flags more resilient through local evaluation, caching strategies, and architectural improvements, but as we’ve grown we hit new scaling challenges that required the team to do a more fundamental rework of our flag service.
This meant:
- Rewriting in Rust (with axum). The team chose this over FastAPI and Node.js. Rust's axum framework was achieving ~32k requests/second, a 21x throughput improvement on Django. The type system made it harder to write buggy code. Most importantly, it gave them proper code-level timeout primitives, eliminating our problematic dependency on PgBouncer-level settings.
- Moving evaluation logic out of the database. PostHog now fetches all relevant person properties, evaluates flag conditions in memory, and returns results without database round-trips.
- Implementing app-level cohort caching. Cohort-based flags were some of our slowest due to complex joins. PostHog doesn’t compute these on demand anymore.
- Simplifying the architecture. The team removed PgBounder entirely. The new service connects to the database directly.
All this led to serious improvements:
- p99 latency when from 904ms to 85.4ms (10.6x faster, 90.5% reduction)
- We reduced costs 68%, dropping the pods required to handle ~500k requests/minute from ~300 to ~90.
- Feature flags didn’t have an outage for 3 months after the migration to the new service
Curious to learn more, check out @dmarticus's post on how we made feature flags even faster and more reliable → posthog.com/blog/even-fast…

English

It costs PostHog $6.67 to successfully onboard a new user with our AI installation wizard.
For this cost, it understands your business logic, captures high quality data, and correctly configures PostHog products in a single command.
In one way, this is incredible value. It’s saved thousands of engineering hours, improved onboarding conversion, and is ultimately a net positive.
In another way, it’s still A LOT of money. $6.67, that’s like 2 cheeseburgers or a full game on Steam. And more than 90% of users use PostHog or free.
The wizard’s success was hiding a lot of waste, so Vincent investigated.
He followed the tokens, investigating context explosion, caching, subagent termination, and more before discovering the agent’s real problems:
1. Repeatedly re-reading the codebase even though it already had the context it needed.
2. Forgetting that it had already compacted the context and re-reading files again.
3. Agent spawning multiple subagents that fail to return or timeout.
Fixing these meant fewer token reads and subagents, lowering costs while keeping efficiency. It was also a lesson not to take your AI agents at face value.
To get the full details on the investigation and everything Vincent learned, check out his blog on “How we caught our AI agent embezzling tokens” → posthog.com/blog/optimizin…

English

@gogainda @posthog nah, we hadn't implemented cohort operations in our MCP yet – just did though! github.com/PostHog/postho…
English

ai is crazy. friend's startup got acquired recently
got a surprising windfall of $500k, wanted to put it into a down payment for a house
i said that was really stupid and they should instead buy 10-15 nvidia b200 tensor core gpus
"think of how many things you could do with that. you might even be able to train a frontier model"
unfortunately by this point i realized they left the conversation about 30 seconds earlier
and this is why ai is amazing, because claude will always hear out my great ideas. real-life people won't
there's a lesson there. i'm not sure what it is, but it's there
English

Update: planned out a solution last night. Sent codex and opus off to implement, spent 2 hours this morning reviewing, refining, and cleaning up and we merged it.
PatrickUllrich@ItsPatrickU
After what feels like the 7th service disruption with @posthog feature flags, I think it might just be time 😔
English

@ItsPatrickU I appreciate it! I'm dylan at posthog dot com if want to email me, feel free to reach out on LinkedIn too (if you'd like!)
English

@dmarticus Let me put together some notes and I’d be happy to connect! We really like Posthog and still considering to roll it out further, it’s been just FF that sadly gave us too much trouble.
English

@ItsPatrickU either way, I'd love to understand more about why you wanted to switch, and while I don't expect to win you back given the effort you've put into building out your own solution, I'd love to understand how to improve for future users
English

@ItsPatrickU and we've stood up a whole team dedicated to scaling out our solution so that we don't run into issues like we've had in the past (e.g. this github.com/PostHog/post-m…)
was there also something about our billing model that didn't work?
English

@adamleithp can't beat blog.jim-nielsen.com/2024/sanding-u… IMO
(i think this is a good thing)
English

@adamleithp UI polish has been really hard for me to nail re: AI-assisted stuff; e.g. for backend things you can use property tests, strong types, etc to encode invariants, but UI is something that oftentimes requires a lot of elbow grease because you don't know it before you see it
English

.@posthog does so much right but choosing an "enabled" feature flag as the icon for all their feature flags is chaotic evil

English

@adityamaru27 @posthog ooof, that is good feedback. Let me see if we can come up with a better asset here
English

wrote about work #fn-1" target="_blank" rel="nofollow noopener">posthog.com/blog/even-fast…
English










