Effective Performance Testing to your Server with Autocannon

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2026
November 16 - 19, 2026
New York, US & Online
Upcoming event
JSNation US 2026
JSNation US 2026
November 16 - 19, 2026. New York, US & Online
Bookmark
Rate this content
Sentry
Promoted
Code breaks, fix it faster

Crashes, slowdowns, regressions in prod. Seer by Sentry unifies traces, replays, errors, profiles to find root causes fast.

Get started

Performance testing expertise that is developed for a long time. In order to measure your server performance you need a tool that can efficiently simulate a lot of abilities and give you good measurements according your analysing criteria.

Autocannon NPM library gave me exactly that - that library is super easy to install and has a very simple API to work with. Within a really short amount of time you can start do performance testing to your application and get good measurements in development environment and in your performance labs, and generate complicated testing scenarios.

In this talk I will introduce Autocannon, explain how to efficiently analyse your server performance with it, and show how it helped me to understand complicated performance issues in my Node.js servers. At the end of this lecture, developers will be able to have the ability to integrate a fast and easy tool in order to measure your server performance.

This talk has been presented at TestJS Summit 2021, check out the latest edition of this JavaScript Conference.

FAQ

Tamar has been writing code for many years and has a passion for it. She has managed large development groups and worked as an architect in several places. Currently, she leads back-end development at XM Cyber.

XM Cyber is a startup that simulates hacker activities within computer networks to help organizations understand vulnerabilities and improve security.

Tamar became an expert in Node.js when she founded her own startup and wrote the entire back-end using this technology. She fell in love with Node.js and started to investigate and understand its deeper parts.

Performance testing is essential to understand how much load a server can handle. It involves measuring various metrics like throughput, concurrent users, and response times to ensure that a server can handle expected traffic.

Throughput refers to the number of requests a server can handle per second. It is a critical metric in performance testing to understand the server's capacity.

Concurrent users refer to the number of users accessing the server at the same time. This metric helps understand how the server scales under load.

The 99th percentile is crucial as it indicates that 99% of the requests were faster than a specific time. This metric is more reliable than the average response time for commitments to third parties.

AutoCannon is a tool for performance testing and benchmarking written in Node.js. It simulates sending multiple requests simultaneously, controlling concurrent users, and managing runtime to test server performance.

You can install AutoCannon via the command line using npm with the command 'npm install autocannon -g' for global installation. For use within JavaScript code, you can install it using 'npm install autocannon --save'.

HTTP pipelining allows sending multiple requests without waiting for the first one to return, whereas concurrent connections simulate multiple users accessing the server simultaneously. Both are essential for accurate performance testing.

Tamar Twena-Stern
Tamar Twena-Stern
36 min
19 Nov, 2021

Comments

Sign in or register to post your comment.
Video Summary and Transcription
The video explores performance testing using AutoCannon, a tool written in Node.js that simulates HTTP requests to evaluate server load capacities. It emphasizes the importance of understanding key metrics like throughput, concurrent users, and the 99th percentile, which helps ensure a server can handle expected traffic. The video demonstrates how to install AutoCannon via npm and provides insights into using it for load testing to measure server performance. It also discusses integrating performance testing with Cypress and highlights the benefits of using HTTP pipelining and concurrent connections. By simulating real-life scenarios, developers can better understand server behavior under typical usage conditions and make necessary improvements.

1. Introduction to Tamar and her expertise

Short description:

Hi, everyone. I'm Tamar, a passionate code writer with extensive experience in managing development groups and working as an architect. Currently leading back-end development at XM Cyber, a startup that simulates hacker activity. I'm an expert in Node.js and have a deep understanding of its inner workings. Follow me on Twitter for more insights and check out my previous lectures on YouTube. I'm also a professional violin player and a community leader in the JavaScript Israel community. Join our meetups if you're in Israel.

Hi, everyone. I'm very happy that you have come to my session about performance testing with Autocanon. But first, before we will really go and do some technical stuff, I would like to introduce myself. So, I am Tamar. I'm writing code for a lot of years. And it's my passion to write code. In addition to that, I was managing large development groups and I was working as an architect in several places. Currently I lead the back-end development in a startup called XM Cyber. It's a really cool startup. What we're doing is we're imitating the activity of a hacker in a computer network. In addition to that, well, I'm an expert in Node.js. And my interest in Node.js had started when I founded my own startup and I wrote my entire back-end with Node.js. At that point I really fell in love with that technology. And I started to investigate it and start to understand the deeper parts of it. And from that point I was really focusing on that technology. And it's definitely my favorite. You can follow me on Twitter and you can find previous lectures of mine in YouTube. In addition to that I have three kids. I'm a professional violin player as well. And I'm a community leader in JavaScript Israel community. We organize really cool lines of meetups. So if you happen to be around and if you happen to be around and in Israel and you encounter a meetup of JavaScript Israel then it's really nice to be there. It's recommended.

2. The Mystery of Performance Testing

Short description:

Let's talk about the mystery of performance testing. It can be confusing due to unfamiliar terminology and measurements. Key concepts include throughput, concurrent users, the 99th percentile, and average response time. Understanding these terms is crucial for simulating servers and improving performance. The main goal of performance testing is to determine the server's load capacity. Working with one docker container helps gauge throughput, and duplicating containers increases the number of concurrent requests. The 99th percentile of response time and average throughput are essential metrics to consider.

Okay, so now let's go to the technical part of the lecture. And I would like to talk a little bit about the mystery of performance testing. Why do I call it mystery? Because let's say that at the first time that I did performance testing I felt like I was climbing on a mountain. Um, well, it was very, very hard and confusing. So why it was very hard and confusing? Because I had so many questions because everybody was talking a lot about a lot of terminology that I did not understand.

So, to which terminology I mean. Well, when you're doing performance testing you're talking about a lot of terms and a lot of measurements that you're not familiar with. And at least for me, at the beginning, left me a little bit confused. So, first of all the throughput. The throughput of the server. So how do you measure the throughput of the server? What does that mean? I mean, I can simulate a lot of scenarios in a lot of ways. So, what is the best way to actually, what is the best way to measure the throughput of the server? In addition to that, concurrent users. So, well, concurrent users, how would that affect my scale? What is it, I mean. What is a concurrent users? What is that mean? What is that measurement? How to simulate that? What is the difference between that and between HTTP pipeline? Another thing that, you know, is very common when you're talking about performance testing and talking about benchmarking, is the 99th percentile. What is the 99th percentile? Why it's very important. Because sometimes when I measure and when people measure, we're looking at the 99th percentile much more than what we're looking at the average. So why the 99th percentile is so important? And the last thing is the average response time, or the response time. So the response time, how you measure it, whether you have to look at the average or the 99th percentile, there is also the standard deviation of the benchmark that needs to be taken into account. So all of those when you first encounter them left me very confused. And I had to understand exactly what I'm doing in order to understand how to simulate my server in order for it to test mean something and really improve my performance.

So let's explain a little bit about all those terms and just a little bit in a high level to like get you in order to all of this. So first of all, of course, the main goal for performance testing is to understand how much load our server can handle. Well, usually you're working with one docker container to my opinion in performance testing and then you're like simulating HTTP request to that like one docker in order to understand what throughput this one docker can handle. And if this one container can handle 100 concurrent requests, when you duplicate it and you create another instance of it, you create another replica, then you're able to handle 200 requests, et cetera. If you create three replicas, then 300 requests. But it's really important to understand how much load one docker container actually can handle. So, important question that was needed to ask. So, what is the 99th percentile of our response time? And what is the throughput? How many concurrent requests can we handle on average? I mean, those are, like, very important questions. And why those questions are important. First of all, the 99th percentile of the response time.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

A Guide to React Rendering Behavior
React Advanced 2022React Advanced 2022
25 min
A Guide to React Rendering Behavior
Top Content
This transcription provides a brief guide to React rendering behavior. It explains the process of rendering, comparing new and old elements, and the importance of pure rendering without side effects. It also covers topics such as batching and double rendering, optimizing rendering and using context and Redux in React. Overall, it offers valuable insights for developers looking to understand and optimize React rendering.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
React Concurrency, Explained
React Summit 2023React Summit 2023
23 min
React Concurrency, Explained
Top Content
React 18's concurrent rendering, specifically the useTransition hook, optimizes app performance by allowing non-urgent updates to be processed without freezing the UI. However, there are drawbacks such as longer processing time for non-urgent updates and increased CPU usage. The useTransition hook works similarly to throttling or bouncing, making it useful for addressing performance issues caused by multiple small components. Libraries like React Query may require the use of alternative APIs to handle urgent and non-urgent updates effectively.
Network Requests with Cypress
TestJS Summit 2021TestJS Summit 2021
33 min
Network Requests with Cypress
Top Content
Cecilia Martinez, a technical account manager at Cypress, discusses network requests in Cypress and demonstrates commands like cydot request and SCI.INTERCEPT. She also explains dynamic matching and aliasing, network stubbing, and the pros and cons of using real server responses versus stubbing. The talk covers logging request responses, testing front-end and backend API, handling list length and DOM traversal, lazy loading, and provides resources for beginners to learn Cypress.
Optimizing HTML5 Games: 10 Years of Learnings
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Optimizing HTML5 Games: 10 Years of Learnings
Top Content
PlayCanvas is an open-source game engine used by game developers worldwide. Optimization is crucial for HTML5 games, focusing on load times and frame rate. Texture and mesh optimization can significantly reduce download sizes. GLTF and GLB formats offer smaller file sizes and faster parsing times. Compressing game resources and using efficient file formats can improve load times. Framerate optimization and resolution scaling are important for better performance. Managing draw calls and using batching techniques can optimize performance. Browser DevTools, such as Chrome and Firefox, are useful for debugging and profiling. Detecting device performance and optimizing based on specific devices can improve game performance. Apple is making progress with WebGPU implementation. HTML5 games can be shipped to the App Store using Cordova.
How React Compiler Performs on Real Code
React Advanced 2024React Advanced 2024
31 min
How React Compiler Performs on Real Code
Top Content
I'm Nadia, a developer experienced in performance, re-renders, and React. The React team released the React compiler, which eliminates the need for memoization. The compiler optimizes code by automatically memoizing components, props, and hook dependencies. It shows promise in managing changing references and improving performance. Real app testing and synthetic examples have been used to evaluate its effectiveness. The impact on initial load performance is minimal, but further investigation is needed for interactions performance. The React query library simplifies data fetching and caching. The compiler has limitations and may not catch every re-render, especially with external libraries. Enabling the compiler can improve performance but manual memorization is still necessary for optimal results. There are risks of overreliance and messy code, but the compiler can be used file by file or folder by folder with thorough testing. Practice makes incredible cats. Thank you, Nadia!

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured Workshop
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Designing Effective Tests With React Testing Library
React Summit 2023React Summit 2023
151 min
Designing Effective Tests With React Testing Library
Top Content
Featured Workshop
Josh Justice
Josh Justice
React Testing Library is a great framework for React component tests because there are a lot of questions it answers for you, so you don’t need to worry about those questions. But that doesn’t mean testing is easy. There are still a lot of questions you have to figure out for yourself: How many component tests should you write vs end-to-end tests or lower-level unit tests? How can you test a certain line of code that is tricky to test? And what in the world are you supposed to do about that persistent act() warning?
In this three-hour workshop we’ll introduce React Testing Library along with a mental model for how to think about designing your component tests. This mental model will help you see how to test each bit of logic, whether or not to mock dependencies, and will help improve the design of your components. You’ll walk away with the tools, techniques, and principles you need to implement low-cost, high-value component tests.
Table of contents- The different kinds of React application tests, and where component tests fit in- A mental model for thinking about the inputs and outputs of the components you test- Options for selecting DOM elements to verify and interact with them- The value of mocks and why they shouldn’t be avoided- The challenges with asynchrony in RTL tests and how to handle them
Prerequisites- Familiarity with building applications with React- Basic experience writing automated tests with Jest or another unit testing framework- You do not need any experience with React Testing Library- Machine setup: Node LTS, Yarn
Detox 101: How to write stable end-to-end tests for your React Native application
React Summit 2022React Summit 2022
117 min
Detox 101: How to write stable end-to-end tests for your React Native application
Top Content
Workshop
Yevheniia Hlovatska
Yevheniia Hlovatska
Compared to unit testing, end-to-end testing aims to interact with your application just like a real user. And as we all know it can be pretty challenging. Especially when we talk about Mobile applications.
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
Workshop
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
API Testing with Postman Workshop
TestJS Summit 2023TestJS Summit 2023
48 min
API Testing with Postman Workshop
Top Content
WorkshopFree
Pooja Mistry
Pooja Mistry
In the ever-evolving landscape of software development, ensuring the reliability and functionality of APIs has become paramount. "API Testing with Postman" is a comprehensive workshop designed to equip participants with the knowledge and skills needed to excel in API testing using Postman, a powerful tool widely adopted by professionals in the field. This workshop delves into the fundamentals of API testing, progresses to advanced testing techniques, and explores automation, performance testing, and multi-protocol support, providing attendees with a holistic understanding of API testing with Postman.
1. Welcome to Postman- Explaining the Postman User Interface (UI)2. Workspace and Collections Collaboration- Understanding Workspaces and their role in collaboration- Exploring the concept of Collections for organizing and executing API requests3. Introduction to API Testing- Covering the basics of API testing and its significance4. Variable Management- Managing environment, global, and collection variables- Utilizing scripting snippets for dynamic data5. Building Testing Workflows- Creating effective testing workflows for comprehensive testing- Utilizing the Collection Runner for test execution- Introduction to Postbot for automated testing6. Advanced Testing- Contract Testing for ensuring API contracts- Using Mock Servers for effective testing- Maximizing productivity with Collection/Workspace templates- Integration Testing and Regression Testing strategies7. Automation with Postman- Leveraging the Postman CLI for automation- Scheduled Runs for regular testing- Integrating Postman into CI/CD pipelines8. Performance Testing- Demonstrating performance testing capabilities (showing the desktop client)- Synchronizing tests with VS Code for streamlined development9. Exploring Advanced Features - Working with Multiple Protocols: GraphQL, gRPC, and more
Join us for this workshop to unlock the full potential of Postman for API testing, streamline your testing processes, and enhance the quality and reliability of your software. Whether you're a beginner or an experienced tester, this workshop will equip you with the skills needed to excel in API testing with Postman.
Monitoring 101 for React Developers
React Summit US 2023React Summit US 2023
107 min
Monitoring 101 for React Developers
Top Content
WorkshopFree
Lazar Nikolov
Sarah Guthals
2 authors
If finding errors in your frontend project is like searching for a needle in a code haystack, then Sentry error monitoring can be your metal detector. Learn the basics of error monitoring with Sentry. Whether you are running a React, Angular, Vue, or just “vanilla” JavaScript, see how Sentry can help you find the who, what, when and where behind errors in your frontend project. 
Workshop level: Intermediate