Async Techniques and Examples in Python Transcripts
Chapter: Why async?
Lecture: Async for scalability
0:00 Next up, let's focus on how we can use
0:02 asynchronous or concurrent programming for scalability.
0:06 I want to take just a moment
0:07 to address this word, scalability.
0:10 Often, people sort of think of scalability as performance
0:14 and performance equaling speed and things being faster.
0:17 And that's not exactly what it means.
0:19 Let's think in terms of websites here.
0:21 That's not the only time
0:23 we might think of this scalability concept.
0:24 But let's think in terms of websites.
0:26 If your website can process
0:28 individual requests 10 times faster, it will be more scalable
0:32 because it won't back up as much, right?
0:35 Scalability doesn't refer to how fast
0:37 an individual request can be
0:39 it refers to how many requests can your website handle
0:43 or your system handle, until its performance degrades.
0:47 And that degrade might be just really long request times
0:50 before you get back to someone or the browser.
0:54 It might mean it's so bad that requests start timing out.
0:58 It might mean that your system actually crashes.
1:00 There's some point where your system
1:02 degrades in performance.
1:05 And when you talk about how scalable is a system
1:07 it's how much concurrent processing?
1:09 How many requests at one time can it handle
1:13 until it starts to degrade?
1:15 As we add scalability to the system
1:16 we might even make it a tiny bit slower
1:18 for an individual request.
1:20 There's probably a little bit more work we're doing
1:22 to add this capability to scale better, maybe.
1:26 It's not exactly talking about individual request speed
1:29 because that actually might get worse.
1:31 However, it means maybe we could handle
1:34 10 times as many concurrent users
1:35 or 100 times as many concurrent users
1:38 on exactly the same hardware.
1:40 That's what we're focused on with scalability.
1:43 How do we get more out of the same hardware?
1:46 And we'll see that Python has a couple
1:47 of really interesting ways to do that.