Getting started with API Load Testing (Stress, Spike, Load, Soak)

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ค. 2024
  • Become a Patreon and get source code access: / nickchapsas
    Check out my courses: dometrain.com
    Hello everybody I'm Nick and in this video I am to show you how you can get started very quickly and easily with Load Testing. I am going to use a tool called K6 for that because of how low the barrier for entry is but also how extensible the tool itself can be.
    Give K6 a star on GitHub: github.com/k6io/k6
    K6 Documentation: k6.io/docs/
    Timestamps:
    Intro - 0:00
    Creating a simple test - 1:39
    Stress testing - 5:41
    Spike testing - 8:20
    Load testing - 9:48
    Soak testing - 11:36
    Don't forget to comment, like and subscribe :)
    Social Media:
    Follow me on GitHub: bit.ly/ChapsasGitHub
    Follow me on Twitter: bit.ly/ChapsasTwitter
    Connect on LinkedIn: bit.ly/ChapsasLinkedIn
    Keep coding merch: keepcoding.shop
    #testing #performance #k6

ความคิดเห็น • 116

  • @paulsanchez5030
    @paulsanchez5030 3 ปีที่แล้ว +37

    I would actually watch the jmeter video too btw... I'm so in.

  • @shelbytimbrook2095
    @shelbytimbrook2095 3 ปีที่แล้ว +27

    Thank you for this insanely simple and straight forward way to do load testing.

  • @yuriiarestov3470
    @yuriiarestov3470 6 หลายเดือนก่อน

    Very helpful! I like that Nick shows all these small and big things that sometimes difficult to find somewhere. One of my fav dev channels!

  • @jabrouni2
    @jabrouni2 3 ปีที่แล้ว +21

    This is great! Would be great to see a similar video on how to go about understanding the limits(load test) of an event/message based application, if possible

  • @millerdrew
    @millerdrew ปีที่แล้ว

    This is a great breakdown of how to get started with K6!

  • @BrammyS
    @BrammyS 3 ปีที่แล้ว +1

    Never knew it was so simple to do, definitely gonna try this.

  • @codezoo
    @codezoo 3 ปีที่แล้ว +1

    This is great, thanks! I’ll start using it today.

  • @chez9044
    @chez9044 ปีที่แล้ว +1

    Such a good tutorial, leaving a comment for algorithm. Thanks mate

  • @chandimalmadhuranga9594
    @chandimalmadhuranga9594 ปีที่แล้ว

    Thank you for simple and clear explanation.

  • @joethompson80
    @joethompson80 3 ปีที่แล้ว +13

    Great info, this is something I always intend to learn about but never know where to start. Thanks!

  • @stefanbogdanovic590
    @stefanbogdanovic590 3 ปีที่แล้ว

    Awesome content Master Nick! Perfect

  • @motizukilucas
    @motizukilucas 2 ปีที่แล้ว

    Looks pretty good. Will definitely be testing this out.

  • @antonscherbuna1163
    @antonscherbuna1163 3 ปีที่แล้ว

    Great video, I will use it as a starting point for performance testing on my project!!!

  • @FahadAlQallaf
    @FahadAlQallaf 2 ปีที่แล้ว +1

    Awesome! Really good video and tool.

  • @uralmb
    @uralmb 3 ปีที่แล้ว +1

    Very nice tutorial. Thanks!

  • @kirankumarb2190
    @kirankumarb2190 2 ปีที่แล้ว +1

    Very well explained 👏

  • @MY-rl6pv
    @MY-rl6pv 4 หลายเดือนก่อน

    so simply explained great job

  • @jalzees
    @jalzees 5 หลายเดือนก่อน

    Great video Nick!

  • @robadobdob
    @robadobdob 3 ปีที่แล้ว

    Nice one. Exactly what I need to know right now.

  • @TheGatewayProductions
    @TheGatewayProductions 3 ปีที่แล้ว

    Nobody likes stress but we can always learn to manage it. Keep it up!

  • @altwathaidar3447
    @altwathaidar3447 3 ปีที่แล้ว

    Thanks man! Thats what I needed.

  • @santattech
    @santattech 2 ปีที่แล้ว

    Hi Nick, thanks for this explanation

  • @nicetomeetugaming7024
    @nicetomeetugaming7024 2 ปีที่แล้ว +1

    Thanks for this amazing video sir!

  • @dangvu534
    @dangvu534 ปีที่แล้ว

    Thank you very much for the excellent explanation!

  • @JonasKeil
    @JonasKeil 2 ปีที่แล้ว +1

    This video is just amazing🎉👏

  • @robbyhechtmusic
    @robbyhechtmusic ปีที่แล้ว

    Thank you! This was very helpful. I'd love to see these applied in JMeter.

  • @romanhrytskiv8845
    @romanhrytskiv8845 2 ปีที่แล้ว +5

    Nice video!
    Tip: you can use CTRL+L instead of clear. Also there is recursive search feature CTR+R

  • @roflcapterzzzy6
    @roflcapterzzzy6 2 ปีที่แล้ว

    Very useful, thanks.

  • @dian_permana
    @dian_permana 2 ปีที่แล้ว

    So cool bro, I have to try it

  • @josemfcheo
    @josemfcheo ปีที่แล้ว

    Thankssss, this is just what i needed, Like and subcribed

  • @jaykishoreduvvuri7598
    @jaykishoreduvvuri7598 2 ปีที่แล้ว

    Nice one thanks for sharing ! Yes need k6 on websites as well please. Thank you once again for this video

  • @7guitarlover
    @7guitarlover ปีที่แล้ว

    Superb video !

  • @Pouya..
    @Pouya.. ปีที่แล้ว

    Thanx man that was huge

  • @Deltacasper
    @Deltacasper 2 ปีที่แล้ว

    This is great stuff :)

  • @barwalgayatri4655
    @barwalgayatri4655 ปีที่แล้ว

    One of the Bestttttttt video .

  • @DaviGn
    @DaviGn 3 ปีที่แล้ว

    Great info! I knew jMeter but I didn't like it too much. Now I can test a logic endpoints sequence in many ways. We'll be implementing this on my work. Thank you!

  • @mihaimyh
    @mihaimyh 3 ปีที่แล้ว

    Will be nice to see something similar for websites.

  • @vicavila7222
    @vicavila7222 2 ปีที่แล้ว

    nice and easy to understand video, pls also do a video with jmeter

  • @dutchrolla420
    @dutchrolla420 ปีที่แล้ว

    Fantastic

  • @yulimusj
    @yulimusj 2 ปีที่แล้ว

    nice. waiting for website testing video

  • @PelFox
    @PelFox 2 ปีที่แล้ว

    Hi Nick, great video and very interesting topic. If this is part of your pipeline, let's say for production deployment. Do you target production or do you set-up a temporary environment or even a slot to load test against? Running load test on the actual production env could affect current users right?
    Also I wonder how you deal with authentication using JWT, can you do some automated refresh step? Since the token would expire running those hour long tests.

  • @fbodirector7464
    @fbodirector7464 2 ปีที่แล้ว +1

    I'd love to see load testing integrated on a website. I am building more APIs than I used to but I still manage a good number of websites that don't consume a dedicated API.

  • @HendriAntomy
    @HendriAntomy 2 ปีที่แล้ว

    Thanks will check K6. I usually use Jmeter but it is hard to maintain it.

  • @kristinlau8018
    @kristinlau8018 ปีที่แล้ว

    Thanks for the awesome video! I have nodejs backend that is hosted in Cloud Run so should I load test locally or on Cloud Run? Do I have to load test all API routes individually or all as a batch like you did in the first stress test?

  • @jaykishoreduvvuri7598
    @jaykishoreduvvuri7598 3 ปีที่แล้ว

    Nice one

  • @Philipicalt
    @Philipicalt 3 ปีที่แล้ว +2

    hello nick, love your videos! maybe you can make a video about sonarQube and how it can integrate with your project and tests

  • @damini6459
    @damini6459 2 ปีที่แล้ว +1

    Hi Nick, I am a performance test engineer I want to know that in Load testing my requirement are put the load around 200 rps not more thant 200rps so is there any technique of throughput controller as we seen in Jmeter or Can I increase more load during test running state like locust tool

  • @orlandofury
    @orlandofury 7 หลายเดือนก่อน

    Yes please the load testing for web apps please Nick!!!

  • @ZiadTorkey
    @ZiadTorkey ปีที่แล้ว

    Great video, I would like to see a video for testing web apps like blazor server

  • @seroleyat
    @seroleyat 3 ปีที่แล้ว

    Awesome video dude, keep going, like and subscribe!

  • @LonliLokli
    @LonliLokli 3 ปีที่แล้ว

    Pricey test for PROD on any cloud, you know ;)

  • @zanesingh
    @zanesingh 2 ปีที่แล้ว

    Hello
    Is it possible to perform correlation using the showcased tool? How can one store a response value from from api call to use in another one? Thanks.

  • @kj2w
    @kj2w 3 ปีที่แล้ว +4

    What would be interesting is if you included an example of 'here is an example of an API that where stressing it caused it to fail.' Then apply some fix, run it again, and compare resulting metrics.
    But great video/idea.

    • @nickchapsas
      @nickchapsas  3 ปีที่แล้ว +10

      This video is a setup for a future video in which I will use a soak test to identify a memory leak in .NET. Just needed to have this one out first for reference.

    • @kj2w
      @kj2w 3 ปีที่แล้ว

      @@nickchapsas makes sense!

  • @man75357
    @man75357 3 ปีที่แล้ว

    Awesome. Can we get on web applications

  • @razvanv339
    @razvanv339 2 ปีที่แล้ว

    great video. One question though: this 'framework' handles just a simple endpoint. How does the project framework look like when we're supposed to handle 10 endpoints? Each endpoint with a separate Load.js, spike.js, etc? Or is it possible to use the same .js file for multiple endpoints; if yes, how does the code look like?Thanks

    • @nickchapsas
      @nickchapsas  2 ปีที่แล้ว +1

      You can manage that in any way you want. The framework gives you the tools for both one or multiple endpoints either in batch or in sequence and you handle the full flow any way you want

  • @portlyoldman
    @portlyoldman 3 ปีที่แล้ว +1

    You seem to be predicting the problems I’m trying to solve.. lol I wonder where I’m going to find someone top notch when I recruit my dev team 😉

  • @eduardot1979
    @eduardot1979 2 ปีที่แล้ว +1

    How do you define a real spike number? I mean looks that you choose a random high number, but how u determine a realistic spike for your scenario. THANKS

  • @DeepakShaw
    @DeepakShaw 3 ปีที่แล้ว

    how about using 'West Wind WebSurge' tool?

  • @ashseth7885
    @ashseth7885 2 ปีที่แล้ว

    Thanks Nick. Request to share video on mqtt load testing with X.509 certificate for .net.

  • @chiragforu
    @chiragforu ปีที่แล้ว +1

    where can i download your code you just showed? for practice?

  • @JamesSmith-cm7sg
    @JamesSmith-cm7sg 2 ปีที่แล้ว +1

    In a CD pipeline which environment would you run these tests against? Would you build a production like environment to run them?

    • @dandoescode
      @dandoescode 2 ปีที่แล้ว +1

      For any commercial system, you should ideally have an environment that mirrors production in terms of performance, but has different data stores. e.g. PRE-PRODUCTION. You could configure K6 as part of the deployment pipeline for your PRE-PRODUCTION environment so that you can easily see performance improvements or degradation over time.
      You could also set up the same thing in your QA pipeline. Although the actual numbers would be different to a production like environment, you could still get a sense of performance degradation or improvement.

  • @nmamatisaev3393
    @nmamatisaev3393 ปีที่แล้ว

    Hi Nick, you said you will be doing this type of video for a web application. Can we expect it soon?

  • @antgod76
    @antgod76 ปีที่แล้ว +1

    Do you have the source code shared somewhere (github or something)? Thanks!

  • @drkrovischa
    @drkrovischa 2 ปีที่แล้ว

    We use NBomber. It is C# based (well, there is F# underneath). As I understand, it should have very similar functionality. But it is C#.
    We were very reluctant to support anything in not-C# and NBomber covers most of our needs.
    There was a bit of a struggle with implementing load tests. But in 9 cases out of 10 it was because of a lack of performance testers in the project and not a fault of the framework.

    • @nickchapsas
      @nickchapsas  2 ปีที่แล้ว +2

      NBomber is significantly less consistent in my experience and less performant.

    • @drkrovischa
      @drkrovischa 2 ปีที่แล้ว

      @@nickchapsas If I remember right, NBomber was initially an internal project for testing a gambling system. And they have some ridiculous number of request - like thousands per second. I would think that they would want to see pretty consistent results.
      On our meagre 30-50 request per second, I haven't noticed any significant inconsistencies.
      Though from the video I see that K6 gives much more detailed result log.
      In case of our project, we decided that we should stick to the C#. In my experience, it is much easier to get other engineers involved with whatever thing you are doing if it is in the same language as the main project. After working for 5 years on a project where development and autotesting were in two different languages, I would rather fight a herd of radioactive monkeys than support anything on Ruby.-)

  • @abrahamrivera3156
    @abrahamrivera3156 2 ปีที่แล้ว +3

    I would just add a POST call to the video

  • @ciberman
    @ciberman 3 ปีที่แล้ว +1

    Question: Do you have to run your test against your CI build? Or your staging? or your prod? How do you compensate the differences in hardware when running test local or in CI?

    • @nickchapsas
      @nickchapsas  3 ปีที่แล้ว +1

      Usually for those tests to tell you something useful, you need to run them in environment that mirror's prod. That is usually pre-prod

    • @ciberman
      @ciberman 3 ปีที่แล้ว

      @@nickchapsas so, you run in your CI against your pre-production? Can the bandwidth of the CI limit the results? I mean, you are "emulating" a lot of different users from a single machine (the CI server)

    • @nickchapsas
      @nickchapsas  3 ปีที่แล้ว +1

      @@ciberman CI would run TF or Pulimi to provision infrastructure specific for the test and servers to execute the tests against it. The CI agent wouldn't run the tests directly but indirectly

  • @asitkumarmohanty2579
    @asitkumarmohanty2579 3 ปีที่แล้ว +2

    So it's similar to that of Jmeter.

  • @nimratmatharoo9258
    @nimratmatharoo9258 ปีที่แล้ว

    How did you plot these graphs ?

  • @AiWalahGuruJi
    @AiWalahGuruJi 2 ปีที่แล้ว

    can you make a video for load testing for mobile apps like react native apps

  • @samuelbrouwer430
    @samuelbrouwer430 2 ปีที่แล้ว

    Please do for websites/web applications also

  • @recepciftci2642
    @recepciftci2642 2 ปีที่แล้ว

    It would be awesome if you show how to test API with xUnit Framework. I know how to test with SQL server but testing with MongoDB in the same way seems impossible.

  • @moinakbhattacharya878
    @moinakbhattacharya878 3 ปีที่แล้ว +1

    Any input about how k6 works with APIs that needs OAuth oidc based authentication will be great

    • @nickchapsas
      @nickchapsas  3 ปีที่แล้ว +1

      You’d have to manage the flow as part of the test or have a stage where you authenticate the users before you start firing the tests

  • @yurimelo3404
    @yurimelo3404 2 หลายเดือนก่อน

    I would take a look at codes about entire stress_test. Where do I figure out this code?

  • @MegaThose
    @MegaThose 2 ปีที่แล้ว +2

    Thanks for the amazing content Nick, would appreciate it a lot if you could create similar content for website as well.

  • @moatazal-ali8589
    @moatazal-ali8589 3 ปีที่แล้ว

    Hi Nick ... Can you please tell me how to create server job to send email to all users without Api still waiting to complete sending all email ... By the way i am using SMTP from Microsoft account .... Thanks 😊

  • @saikiranreddypasham3765
    @saikiranreddypasham3765 2 ปีที่แล้ว

    How to authenticate the API with bearer token in K6 ..? Need help

  • @cmtv357
    @cmtv357 2 ปีที่แล้ว

    Please make one for Web with dependency injection please.

  • @ClAddict
    @ClAddict 3 ปีที่แล้ว

    Would love to see how to integrate a stress test into the check-in process with multiple devs committing several times a day. Is the pattern to bottleneck on a single deployed environment? Or how do others manage to run tests where code needs to be deployed to validate a pull-request?

    • @billyterblanche
      @billyterblanche 3 ปีที่แล้ว

      I think this is something that would need to run on a nightly schedule and not after each push. That way it does not block the build pipeline and you still get performance results daily. If needed you should also be able to run this type of build manually if there is a need to push something out to production and you want to ensure that there is no performance degradation before releasing any code. It all depends on what you want...

  • @balajibalu3525
    @balajibalu3525 2 ปีที่แล้ว

    can we handle the constant options in the command line for load testing

  • @user-vo2yt2pb2n
    @user-vo2yt2pb2n 11 วันที่ผ่านมา

    very cool, I cannot find your code.

  • @clearlyunwell
    @clearlyunwell 2 ปีที่แล้ว

    👍🏽

  • @clashclan4739
    @clashclan4739 2 ปีที่แล้ว

    Link for JMeter video pls... if not pls make it

  • @Hakim2898
    @Hakim2898 2 ปีที่แล้ว

    do a jmeter please...

  • @michaelroughton
    @michaelroughton 2 ปีที่แล้ว

    Where is the code you are using in your videos?

    • @nickchapsas
      @nickchapsas  2 ปีที่แล้ว +1

      It’s available to my Patreons

  • @pyrejke2991
    @pyrejke2991 3 ปีที่แล้ว

    As far as I know target is virtual users. the question is - is virtual user = ordinar user from real life?

    • @nickchapsas
      @nickchapsas  3 ปีที่แล้ว

      This depends on how you set it up. They can certainly reflect an ordinary user yeah

    • @pyrejke2991
      @pyrejke2991 3 ปีที่แล้ว

      @@nickchapsas how it can be configured?

  • @yiowruvern2932
    @yiowruvern2932 2 ปีที่แล้ว +1

    Oops, I thought this was another kind of API ... 😂 I was looking for API (American Petroleum Institute) but got shown this ...

  • @chigozie_jesse
    @chigozie_jesse 2 ปีที่แล้ว

    Please can you include the link to the code on your repository

    • @nickchapsas
      @nickchapsas  2 ปีที่แล้ว +1

      The code is available to my patreons

  • @Radictor44
    @Radictor44 3 ปีที่แล้ว

    This blows JMeter out of the waters

  • @rajbaral
    @rajbaral 2 ปีที่แล้ว

    Can you share the source code for this?

    • @nickchapsas
      @nickchapsas  2 ปีที่แล้ว +1

      The source code is available to my patreons

  • @cryptixh2795
    @cryptixh2795 3 ปีที่แล้ว

    Running the tests on local machine, won't give real results cause it depends on your computer. What we might do to make the tests more realistic

    • @nickchapsas
      @nickchapsas  3 ปีที่แล้ว +2

      I never recommended that you run the tests locally. You run the tests against a pre-prod environment from a good server.

  • @secretagent5209
    @secretagent5209 2 ปีที่แล้ว

    js load tests 🤣🤣🤣

    • @nickchapsas
      @nickchapsas  2 ปีที่แล้ว

      It’s a js engine but the tests are run in Go

  • @xtinctspecies
    @xtinctspecies ปีที่แล้ว

    Great video Nick!