text
stringlengths
0
2.35k
• Development of a production-simulated testing environment using Kafka logs to replicate production traffic.
• The speaker discusses how pre-submit tests in large companies can work well at scale, but may not be effective in smaller businesses due to limited sample size.
• Pre-submit tests are seen as a good approach for large companies with high volume and scale, but unit tests are still necessary for early-stage development.
• Pinterest uses an OpenTSDB backend for general observability and an internal tool called Statsboard for visualizing time-series metrics and defining alerts.
• The company has a custom solution for pre-submit tests that involves exposing metrics through an HTTP endpoint using the expvar library from the Go standard library.
• Pinterest's infrastructure is primarily based on Python, Java, and C++, but the ads team uses Go heavily for online serving due to low latency and high developer velocity requirements.
• The speaker discusses the challenges of tuning garbage collection in large-scale companies and notes that the Go team has recently added new features to improve this process.
• Discussion on the benefits of taking time to analyze GC (garbage collection) impact on services
• Comparison of Go's early days to its current state in terms of performance optimization
• Importance of tooling for understanding system usage and bottlenecks
• Need for official guides and tutorials on using performance tools like pprof and flame graphs
• Balancing premature optimization with the need for future-proofing and scalability
• Challenges of legacy systems and refactoring due to hypergrowth or changing product offerings
• Discussion on the eternal quest for balance between velocity, incidents, and system complexity
• Examples of modularity and config-driven systems to improve velocity and reduce system complexity
• Existing services were not optimized for performance and scalability at Pinterest's early stages
• Investment in better tooling and infrastructure has made it easier to optimize for performance and scalability
• At some point, there was a lack of centralized framework for ad-serving infra, leading to divergence in code quality, test coverage, and implementation logic among teams
• Standardization efforts are underway to standardize frameworks and tools across ads product teams
• Recording and communicating infrastructure decisions within teams and broader teams is done through standardized documentation templates, Production Readiness forums, email aliases, and detailed analysis documents
• Junior developers can learn by getting involved in incidents, observing discussions, and reading up on system documentation
• The value of knowledge gained from system owners or experts through their discussions and hypothesizing about system faults.
• The benefits of observing recurring issues and using past solutions as a guide for current problems.
• Onboarding process for new team members, including assigning an onboarding mentor and bi-weekly team meetings to share questions and suggestions.
• Nishant's unpopular opinion that working with non-typed languages can be challenging at large scales.
• Discussion of the trade-offs between typed and non-typed languages, with Jon Calhoun and Johnny Boursiquot sharing their perspectives.
• The importance of considering trade-offs in technology decisions
• The impact of ego on technology decision-making
• The role of experience and context in evaluating language complexity
• The challenges of switching languages as a company grows
• The lack of data to support definitive conclusions about language choice for different stages of company growth
• Personal anecdotes and humor regarding the snow outside
**Johnny Boursiquot:** Alright, welcome, one and all. Today we have a special guest that is joining us to talk about scale. Scale stuff. But before I introduce him, I want to acknowledge my co-host who decided to join me last-minute, and I welcome him very much... Jon, welcome back.
**Jon Calhoun:** Thanks for having me, Jonny.
**Johnny Boursiquot:** So today's guest is Mr. Nishant Roy. He is an engineering manager over at Pinterest, and Pinterest deals with a lot of scale, as you would imagine. There's a lot going on over there, and we figured, hey, why don't we bring Nishant over and talk about some of these things? And obviously, talk abou...
**Nishant Roy:** Yeah, thanks so much, Jonny. Nice to meet you, Jon, and Jonny as well. Hi, everyone on the stream. So yeah, I'm Nishant, I've been at Pinterest for just under five years now. I lead the ad serving platform team here. I started out as an intern actually, close to six years ago now, on the same team. The...
What brought me to Pinterest is actually a little different than what I'd say most people's answers are. I met some of the team on campus at Georgia Tech while they were there recruiting, and I really enjoyed talking to both the recruiting team, as well as some of the engineers and product managers who were there. As p...
**Johnny Boursiquot:** Awesome, awesome. So you've been there for quite a while, so you've had a chance to see the organization, the engineering organization, at least you're part of it, mature and grow as well, yeah?
**Nishant Roy:** Yeah. And the big change, I think, was obviously going from a pre-IPO company to going public, and seeing how various things change around that, not only from a day-to-day engineering work, but also communications that go out within the company, outside the company... It definitely did really impact ho...
**Johnny Boursiquot:** Okay. So the life of an engineer day to day at Pinterest, working in your group, looks like what, generally speaking?
**Nishant Roy:** Yeah, so back when I started, again, the team was much smaller; the overall ads organization was much smaller, so things were moving a lot faster. We had less checks in place for things like -- if we're talking about scale and CI/CD today, we didn't have as robust a system as we do today. People were a...
\[06:13\] So at that point, there was less process, essentially. If you had your own idea, go write the code, you essentially just needed one person to sign off on the code review... Less compliance and blocking reviews at that time. Go ahead, put your change out, present your metrics, your experiment, your A/B results...
Now there's a lot more process; not necessarily a bad thing. I know process has a pretty negative connotation... But what it means - we have way fewer severe incidents at least, and that means more people at the org have an understanding and a say in what changes are going out and what reason they're going out for. So ...
**Johnny Boursiquot:** Okay. I imagine that some changes require more scrutiny than others, right?
**Nishant Roy:** Definitely.
**Johnny Boursiquot:** So if it's a quick bug fix, you probably don't go through that same extensive process every time, right?
**Nishant Roy:** Yes. So we have a more lightweight process for smaller bug fixes etc. And the criteria for that, essentially, is as long as there's not a significant change to any of the 10 to 15 top-line metrics that the org has decided are vital to monitor, that change requires the old process, essentially; you get ...
**Johnny Boursiquot:** Okay, so part of being able to deliver changes, big or small, is having some sort of an integration and delivery pipeline, right? So it's the same process, I would assume, whether the change is small or big; you're going through the same -- from a technology standpoint, from an automated process ...
**Nishant Roy:** That's right.
**Johnny Boursiquot:** Okay. So with that said, what are the stages of this pipeline? So I'm thinking, generally speaking, most people only really have -- they do their unit tests locally, and there might be some integration tests that happen in the cloud, and maybe there's a staging environment involved... For most pe...
**Nishant Roy:** Yeah, and I'm happy to say that this is something that's evolved a lot as we've scaled as well... So just backing up again to what I do - as part of leading the ad serving platform team, our responsibilities are to enable the ads team to continue to grow and deliver and launch more products, new algori...
The other side of that obviously is, again, going back to scale and compliance, making sure that our systems are scaling at an ideally sublinear cost rate. So for every dollar made, we don't want to be spending an additional dollar; that's one condition. And then also, as the number of engineers grows, and the number o...
So what this was like when I joined Pinterest was - I'm proud to say that the ads team was one of the first teams to have a continuous deployment process, so there was a pretty good foundation for me to build on top of. Essentially, when you committed your change, within let's say the next 30 minutes it would hit a can...
\[10:12\] Once it passed that initial canary test, which is about a 10 to 15-minute test, it would go out to what we call the staging, but let's say like a larger canary essentially, which was at that point let's say about 1% of the cluster, of the entire production cluster. This is all serving production traffic, so n...
What we've evolved a lot since is we no longer require the on caller to go manually pause deploys, or roll back deploys. We have a system in place, it's built on top of Spinnaker, which is an open source platform from Netflix, if I remember correctly... And essentially, your CD pipeline will automatically pause the dep...
Besides that, what we built in - you mentioned integration testing, and the fact that some people sometimes will run some local testings and push out their changes and wait for feedback in production... We realized that was actually one really big gap, because there was no great way of enforcing that people were actual...
So we wanted something more uniform, that applies to every single change. Every single code change runs in a reasonable amount of time, doesn't require developers to be sitting there for an hour while their tests run, and then gives us reasonable confidence that if this change goes out, we're not saying that it's defin...
We wanted to make sure, and I think we successfully achieved this, that this test is able to run in less than 10 to 15 minutes... Because one of the great parts of Go in our relatively smaller codebase at that point was that our entire repository, or entire service at least, was able to build an artifact in about, I wa...
\[13:57\] Those were the two key parts that came out, was this pre-submit integration testing, which allowed us to actually define which metrics need to be monitored, and then secondly was this automated canary analysis essentially, which is, I think, an industry-wide practice at this point... But that really saved us ...
Similarly with the pre-submit test themselves, when we first rolled it out, the infra team just configured 10 metrics, I think, which are mainly system performance-related. Now we're up to about 90 metrics, added by all sorts of product and quality teams to ensure that their particular slice of the ads pie doesn't go d...
**Johnny Boursiquot:** So it sounds like you're kind of testing in production, pretty much...
**Nishant Roy:** Yes and no. So the ACA, the Automatic Canary Analysis is happening in production; our pre-submit testing is not happening in production. It's essentially replicating production traffic and sending it to a couple of dark side of hosts, which is not actually serving any actual user traffic.
**Johnny Boursiquot:** Okay, so you simulating what would have happened had it been hit by the actual traffic. So I'm assuming that traffic basically was captured from production, actual production environments, and then you just basically replay it against the canary.
**Nishant Roy:** That's right. We essentially just log 1% of all production traffic to a Kafka topic, keep it around for about two or three days. And that's constantly being refreshed, and we can constantly use that to replay and simulate what would happen, like you said, if that binary was being served to production u...
**Break:** \[16:11\]
**Jon Calhoun:** So when people think about testing, I think a lot of the time the first thing that pops in their head is like unit tests, and these smaller things that happen offline... Would you say that introducing all of this stuff has caused developers to focus less on that, because you have these basically produc...