More concurrency improvements

Jonathan Swenson · Friday Demos · January 10, 2025 · 6:29

Speed is a first class category of work for Omni. Continuing the focus on keeping the app speedy through high concurrency, and hammering out hotspots.

Try it yourselfThe full week on docsadministrationperformance

Transcript

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

  1. hey um feel free to hop in at any point Chris or Nancy about what I'm showing here because I probably will forget something um but we've been hard at work mostly uh Nancy running a lot of tests and tweaking parameters and kicking things off and me trying to figure out what they actually mean and trying to fix things behind the scenes um but sort of I wanted to Showcase sort of one of the processes that we kicked off sort of last night um we were sort of taking a look yesterday we were running some tests we were trying to figure out what one of the bottlenecks were so we have this is kind of comparing to runs but we kind of noticed that um this

  2. is um our we'll call it the data right Span in the query execution endpoint we noticed that like things were getting pretty hot here this is a 95th percentile we can show the max like definitely as the test round it ramped up you know some of them were taking almost 3 seconds um and we we were trying to figure out like why what what's going on here in addition we are seeing that these these really high spikes in operate executing you know the the job state store and this is you know things that are effectively free under low load um but really when you start ramping up the load and hitting the the Omni instances with hundreds of hundreds of requests per second and pushing

  3. past that um you know start to slow down a little bit we wanted to make sure that under the sort of higher load conditions um contined to Hold Steady um which would give us more room to um to to scale up how much traffic we're going to do um after much you know load testing and running we kind of identifying these hot spots um Chris and I and Nancy were kind of talking through like what are some ideas for how to um reduce the the sort of execution times in some of these places um one of the things we found is that in our uh persist one of our data persistence layers for the cache um in uh data transfer um we were seeing that

  4. um a parent ly if you're writing to the same folder lots of requests to the same folder it is slower than lots of requests to different folders so one of the things that I I threw in late last night was okay cool let's just distribute the load to for an individual say organization within multiple subfolders for that organization so let if you have one really hot organization um you'll run into something like this um and instead we can make sure that that a single organization that's really hot is still um Distributing load over multiple in this particular case I think it has something to do with the uh distributed I noes in the file system but is splitting that over the the load and can

  5. really smooth out traffic so one of these things we seeing this is this is the P95 time which is you know the the maximum 95th per pile of these requests you know we kind of cut that down in half at the um sort of middle of these loads and really it pretty significant here um at some of the higher loads but like relatively looks a lot more stable as the load increased in some of these things similarly we were seeing that there's really sort of it changed really variable and significantly higher um in uh load or timing characteristics when we loaded the job State updates so this is what happening when say a plan or execution completes we want to update the state so that

  6. we can U process that information and be able to say run the query afterwards or to return the results of the query um and we were seeing that it was pretty um variable and slow um and it turns out that with the as synchronous Library we were using for database connectivity was not performing anywhere near as well as the database um the database um Chris had turned on some performance logging and we were seeing that like the queries were taking uh you know I I don't remember exactly what the numbers were but they were taking you know 100 milliseconds or less I think 100 milliseconds was maybe some of the maximums there but it was looking like it was taking in some cases up to

  7. two seconds or 1.5 seconds to actually do that update and something was going wrong in our layer and we found that our um database connectivity layer was adding some overhead underload that we really didn't want to see um and that sort of led us to I basically swapped out the the layer that we're using to connect um there's a couple more changes that we want to make there as well but that sort of really reduced the variability and and the time you're seeing here we can kind of see that across the board for many of these updates really this this up here is the on the the right is is the one of the previous loads I just picked one randomly Nancy um from before

  8. for this stuff um but when we can see when we made that change it dropped significantly uh in there one of the things we did notice though um is that and maybe because we are executing more things at the same time um um maybe I'm looking actually no I'm looking at this wrong oh that's the plan so this is the time to connect to the actual data so in this case we're we're connected to a RDS postest instance and maybe because we're now issuing more requests the time to connect to that database is starting to take a little bit longer um maybe it's just you know most of the database was under different characteristics at what time but the time to connect and execute um

  9. kind of was swapped and probably because we're loading it more and we're able to issue more requests at the same time in or or at higher rates um so you know there's definitely like a a trade-off here where it's like if we add more we speed up all of our overhead all of a sudden we can issue more requests which then slows down the overall requests because there's more of them happening at the same time um but overall we definitely saw a a dramatic difference here we were able to issue um I think this is split over all three of the requests they're making in this case so this is an embed login a dashboard meditator request and a query execution request um for ten

  10. tiles um so we are issuing um you know significantly more requests per second and the request response time P95 is down even though the actual work that we're doing so connecting to the database and running the query um that time has gone up so like we would definitely see yeah cool if we scaled out that um we'll call it the client database in air quotes there um if we scale that up to be able to handle more traffic at higher performance then maybe these requests would go down even further um so kind of a quick look into some of the load testing characteristics we're doing there's been a many many many of these okay cool found a new bottleneck let's tweak it let's see how

  11. much further we get um over the last couple of weeks and a real shout out to Chris and Nancy for um you know persisting with and making sure all these things are happening