More performance improvements

Nancy Chacko · Friday Demos · May 30, 2025 · 3:47

A bunch of new work to improve general app performance, plus some conversation and how we discovered and monitor the outcome.

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. All right. Um, let me find my screen real quick. Okay. So, I'm going to talk a little bit about um a pretty big win we had this week with um event loop lag. I'm going to take us on a little bit of a journey because I don't think we've really talked about it as a whole company here.

  2. So, uh maybe a month or two back, we started seeing some transaction timeouts happening relatively frequently on production and we try to figure out what's going on. The query should be relatively fast, but but things weren't looking great. um we were able to grab traces in Sentry and we started to see patterns like this where the overall operation was taking a significant amount of time but every piece beneath it was nice and speedy and fast.

  3. Um so the query wasn't slow, reading it wasn't slow, serializing it wasn't slow but overall it was taking a significant period of time that led us down a whole lot of research which led us to the event loop in node. So, node there is I'll just show a a real pretty picture that node provides. I will not explain it because I don't understand it super well, but this is here for anyone who really wants to dig in deeper.

  4. The core of it is node has a single threaded event loop which essentially every async asynchronous request blocks through. So, if you slow down that event loop, you're slowing down every request on that container at once. And that's what we were starting to see happening. So, we went through some effort, were able to add in a bunch of logging.

  5. So, we could start to now figure out what were the the requests that were coming in that were causing this lag to happen. Um, and from there, we were able to gather up whole bunch of amazing data that looks like this that would start to tell us what were the the end points, the routes themselves that were taking, this is probably not very readable, that were taking a lot of time.

  6. Um, the biggest things that popped out of this were typically model downloads, like full model downloads that had to come through Remix to make their way back to the browser were causing significant event loop lag. And so this is really on behalf of of Meredith and Luke because they did all of the work here. They went and found the way to properly stream that model back to the client so that Remix wasn't having to sit there and do all this the serialization deserialization that was causing this lag in the first place.

  7. So from there, we released that yesterday around 2:00 p.m. uh Eastern time. Um and so starting to look at some of the results, I looked at the 9 to 11:00 a.m. hours yesterday. Um and what we saw during that time frame is we had 93 requests coming in that had over a second worth of lag. And what that means is during those time periods of lag, everybody in on that container was slow.

  8. every request whether or not it was causing lag or not was slow during those time frames. And then after this fix went out, we had seven in that equivalent time period today. So we still have a lot of work to do. There's still um a ways to go. If anybody's really interested, you can always go on to our dashboards here in Cloudatch.

  9. We have all sorts of uh attempts to show how beautiful this looks with time. Um let me kind of we'll go to sum here real quick. So, and I'll take heavy duty out of the mix. It's hard to tell. It looks like maybe we're getting better right now, better than kind of these these slightly higher peaks that we've seen in the past.

  10. But with time, this should start to kind of show whether or not we're we're moving in the right direction. We definitely have taken out some of the biggest cause of lag at this point, and we're going to continue to attack them as we go forward. But all of this should mean that overall our system is feeling more responsive across the board.

  11. That's it.