164 points · by ryangoldman · 9y ago · 87 comments
Makes you wonder if a couple of their clients paid for this error monitoring service, then quit watching it. That's a lot of errors.
I wrote more about this and other techniques for battling noise here: https://blog.sentry.io/2017/03/27/tips-for-reducing-javascri...
Btw, it's on average 7.5k events per second. Not that drastic but of course peak, not average is what matters.
I'm not super happy that this number is in the title because I find this number myself very irrelevant to our operations (not even sure this number is correct, it sounds too small). What's more challenging to us is the complexity of individual events and the bursting of it. A lot of interesting engineering went into that.
Errors on even a tiny fraction of our users can be significant -- we immediately hit the free tier cap. 20B/month does not surprise me at all, especially considering some users are going to be overzealous in their event reporting.
Effectively what we do is:
SELECT * from groups where ID IN ( SELECT group_id FROM index WHERE key = :searchKey AND value =:searchValue UNION [...] )
(This is a simplification but it should give you an idea of how the queries are built)
Because of the way the model works, its very hard to do certain things like exclusion queries, and more importantly all of the results you're seeing are still cached. The biggest pain point here is if you're searching for e.g. "ConnectionError environment:production", you really don't want to see anything related to non-production. We're solving that problem immediately, but its just the tip of the iceberg.
Next year we're kicking off a large project to overhaul the key infrastructure which powers the stream/search functionality, with some pretty big ambitions.
Other services in the space generally use something like Elastic search, which can provide some of this out of the box. We've always been built on SQL/Redis, and given that Elastic has its own set of problems we've decided that it's likely best for us to move to a columnar store format that doesn't cache results (e.g. counts), but rather computes them in real-time much like Scuba.
It was eye-opening to see what is possible when you have an organization like theirs where you have a lot of talent and pride in your product across the board.
Let’s do the math.
So it’s 20B/30 = 660 m / day
660 / 24 ~= 25 m / hour
25000k / 3.6k sec = 8000 events/sec
Now peaks got to be larger then these measly 8000 events.
Even say peak is 50k/second.
Dang an Nginx can serve a web page faster then that on a single modern notebook. CPU won’t even saturate to do that.
Or if you were to write them to a consumer grade spinning drive disk at 100mb/s you’d get 50k/s if each event is 2kbytes in size.
As usual I’m not impressed.
I hear you, I hate misleading examples too.
> Dang an Nginx can serve a web page faster then that on a single modern notebook.
"What? Your moon-rocket can only fit three people? My couch can do six. I am not impressed."
I my view it helps to understand scale.
More real world example an API at my work logs routinely more then 20M+ events per day, all indexed for NRT search. It’s just a byproduct of the actual work though.
It’s considered business as usual, nobody counts how it adds up half a billion per month.
I assume they index it in some search engine as well. Yeah the scale is x20 bigger, but it’s their _primary_ task.
But do your events require you to process gigabytes of debug symbol data per event? Or through megabytes of JSON sourcemap data to unobfuscate stacktrace where some operations are not even possible in linear time?
Don't forget a Sentry event is not a simple data blob we store. It requires very expensive and complex processing.
And really, in terms of load - at that scale it's all pretty impressive. The payloads are big. They contain the full stack trace along with most the local vars.
- 40k per event (average, it gets into 2mb territory for some)
- streaming processing of everything on the fly
- storage/querying of data
Processing 8k * 40k is a feat but I’d think you have more then a few dozens of nodes.
Then it gets into ~100s ev/s per node territory. Quite manageable even for e.g. complex search engines to ingress.
Of course, it all depends on where your bottlenecks are.
The actual event ingestion from an external consumer to our queue is indeed very boring. What makes Sentry internally complex is how incredibly complicated those events can get. For instance before we can make sense of most iOS (as wlel as other native) or JavaScript events we need to go through a fairly complex event processing system. A lot of thought went into making this process very efficient.
Also obviously even if a problem like ours can be easily solved in parallel, you don't just want to add more servers you also want to run a reasonably lean operation. Instead of just throwing more machines at the issue we want to make sure we internally do not do completely crazy things but optimize our processes.
Roughly speaking you take what a laptop can do and a multiply it by 1000x to estimate what a cloud service could easily do. (It’s just an estimate, the reality is not working like that, I KNOW)
Do not take it as Nginx and webpages example, it’s indeed a poor analogy.
I can’t remember the right number for e.g. ElasticSearch fuzzy search across 10m documents of out hand so I’d pick the simpler less relevant number.
Actually fuzzy full text search across 10m documents is at least in the range of 100s/sec on a laptop. Meaning that they have resources to do at least e.g. 100k-500k/s full text searches across gigabytes of symbols.
I bet their queries are simpler then that though (not fuzzy nor full text). It’s debug symbols after all not a natural text.
If you (or anyone on this thread) is interested in learning more, please feel free to ping me.
Yes I’d like at least 1k/s per node. That’s something interesting.