Async Techniques and Examples in Python Transcripts
Chapter: asyncio-based web frameworks
Lecture: Load testing web apps with wrk
0:00 So I said that now you have better scalability.
0:02 You have better performance.
0:04 Do you take my word for it?
0:06 I wouldn't. I didn't actually.
0:08 I said, okay, I'm going to convert this to Quart.
0:10 Now, unless I see an improvement
0:12 I'm actually going to not even cover it in this course.
0:15 Spoiler alert, it's going to be better.
0:17 But, how do you know?
0:18 You want to do proper load testing.
0:21 So, here's a tool called wrk, and it describes itself
0:25 as a modern HTTP benchmarking tool.
0:27 And you can see the URL right there at the bottom.
0:29 So, you can go get this and install it
0:31 and then use this to test your web app.
0:34 Well, how do you get it? If you happen to be on Mac OS
0:37 you're in luck. You can use Homebrew.
0:39 If you don't know what Homebrew is, check it out at brew.sh.
0:42 It's really awesome.
0:43 That's the way I manage lots of things like Python
0:45 and Node and all those types of things on my machine.
0:47 MongoDB, for example.
0:49 Install them and upgrade them with Homebrew.
0:51 So, wrk can also be installed with Homebrew.
0:53 brew install wrk. Boom, done.
0:56 Now I know the stats on OSs
0:58 that people use to work with Python.
1:00 OSX, as they have here, or Mac OS
1:02 same thing, combine it, and it's been renamed basically
1:05 is a very small percentage.
1:07 Even though it might appear that, you know
1:08 go to a conference, everyone has a Mac
1:10 I think it's like 15 to 20%.
1:12 So that leaves a whole bunch of other folks
1:13 who may want to use wrk. How do they get it?
1:16 Well on Linux, on Ubuntu, you can go
1:18 and check it out and compile it from source.
1:20 I don't really like that answer.
1:22 I don't really like that as an option
1:23 but it's better than you don't get it.
1:25 So, you can check it out and compile it.
1:28 On Windows, the answer is a little bit less good
1:30 than that not so good answer.
1:32 And that is on Windows 10 you can get wrk
1:36 because you have the Ubuntu Subsystem on Windows
1:39 which you can turn on
1:40 and then you can get wrk source and compile it there.
1:44 Okay, so these are your options you have for the other OSs.
1:47 But you don't actually have to run this.
1:48 You can just look at the numbers that I'm going to show you
1:50 in the next video and you can basically
1:53 do the takeaways for yourself.
1:54 But if you want to try it for yourself
1:56 then here is a tool that I used
1:58 and here's how you get it and install it.