Can NODE.JS Server Handle 1M Concurrent Requests? | Real-World App Benchmarking on Dedicated VPS

  Рет қаралды 56,459

CoderOne

CoderOne

Күн бұрын

Ever wanted to push the limits of your Node.js Server and see what can really Node.js Handle? In this video we will push the limits of a Node.js/Express.js Server that is built with Login/Register and Authentication and some interesting calculation functions to see how can it operate when it comes to thousands of concurrent connections and millions of requests. We will stress test using 1K, 10K, and 1M concurrent connections connected to the server at the same time and sending requests to the server from a simple HTTP GET Homepage to random login/Register API stress test throughout the HTTP Protocol and see if really Node.js can handle 1M requests/s?
⭐ Timestamps ⭐
00:00 How we'll do Nodejs Benchmarking?
02:19 Briefly understanding how Node.js Event loop works
08:36 Getting Started with Benchmarking
12:37 Using autocannon for HTTP Server benchmarking
20:45 Can Node.js Actually handle 10K Requests on our local machine?
23:46 What about 1M concurrent requests?
25:39 Creating Custom Benchmarks scripts programmatically using autocannon
34:57 Benchmarking Register-Login API with custom script 10K User registration
46:24 Running Node.js Server Benchmarks on Dedicated VPS Server
49:22 Running basic GET homepage benchmark for 1k concurrency
50:59 Benchmarking 10K Users for 1000 Requests for user
53:20 Is 1M Concurrent requests possible on a 2-Core CPU and 2GB RAM Server?
54:26 Benchmarking Register-Login on the Dedicated VPS Server, is it possible for 1K?
58:41 Why Nodejs is bad for processor-heavy tasks?
⭐Grab the full source code of the App with Benchmarks on Github:
github.com/ipenywis/node-expr...
🧭 Watch Tutorial on Designing the website on Figma
• I Design a onecolor We...
🧭 Watch Create a Modern React Login/Register Form with smooth Animations
• Create a Modern React ...
🧭 Debug React Apps Like a Pro | Master Debugging from Zero to Hero with Chrome DevTools
• Debug React Apps Like ...
🧭 Master React Like Pro w/ Redux, Typescript, and GraphQL | Beginner to Advanced in React
• Master React Like Pro ...
🧭 Learn Redux For Beginners | React Redux from Zero To Hero build a real-world app
• Debug React Apps Like ...
🧭 Build Login/Register API Server w/ Authentication | JWT Express AUTH using Passport.JS and Sequelize
• Build Login/Register A...
🧭 Introduction to GraphQL with Apollo and React
• Introduction to GraphQ...
🐦 Follow me on Twitter: / ipenywis
💻 Github Profile: github.com/ipenywis
💡 My Blog: ipenywis.com
Made with 💗 by Coderone

Пікірлер: 50
@williamabboud
@williamabboud 2 жыл бұрын
That was quite interesting and very insightful. Thank you !
@LukasSkywalker_
@LukasSkywalker_ 7 ай бұрын
If there is a database, it will almost always be the bottleneck. Caching, indexing, etc helps. Not the porpouse of this video, but running multi nodejs instances with pm2 or k8s is a good way to scale also. I'm a software engineer for a bank. We have a lot of unique and concurrent users (I'm not allowed to say the exact number but it is way above the tests of this video) and the main service is powered by node. It is handling well at most cases, with the things I mentioned previously. It is not the most performant language/VM but is good enough.
@kevinjimenez6143
@kevinjimenez6143 2 ай бұрын
You use Typescript?
@lunix8028
@lunix8028 9 ай бұрын
Loved the content man, thank you very much!
@mdshadab3470
@mdshadab3470 Жыл бұрын
Bro you just rock. This video worth watching really 🔥🔥🔥
@raymondmichael4987
@raymondmichael4987 Жыл бұрын
I'll rewatch this; Thanks brother
@neelthakkar4492
@neelthakkar4492 3 жыл бұрын
Seriously underrated channel. But don't worry you are going to get 100k+ in nearby future.
@namaefumei
@namaefumei 5 ай бұрын
Learned a lot. Thanks!
@oussamasethoum2755
@oussamasethoum2755 3 жыл бұрын
Good information, Thank you.
@mahendranath2504
@mahendranath2504 3 жыл бұрын
Thank you So much 👍🏼🙏🎉❤️
@akeemovic
@akeemovic 2 жыл бұрын
Great job! 👍 Please make a NodeJS scaling tutorial.
@kienang7850
@kienang7850 3 жыл бұрын
Hi, if we use nodejs cluster, can it do better?
@vishutiwari99
@vishutiwari99 3 жыл бұрын
One of the most underrated KZfaq channel .
@mdsamir8495
@mdsamir8495 3 жыл бұрын
Awesome
@oktachandra1851
@oktachandra1851 8 ай бұрын
have you tried nodejs cluster combine with worker-thread to load heavy concurrent requests ?
@arpitabali3621
@arpitabali3621 2 жыл бұрын
which version of node have you used in this video??
@kaioh1384
@kaioh1384 2 жыл бұрын
amazing
@mohamedyoussef8835
@mohamedyoussef8835 Жыл бұрын
Awesome video ++++++++++ 🙂
@ziyaasgarov6973
@ziyaasgarov6973 3 ай бұрын
Thanks for the video. Could you please suggest which programming language/framework would be the best for handling heavy tasks on the backend side?
@tigertiger9911
@tigertiger9911 3 жыл бұрын
How to scale node js app
@dheerajkukreja4269
@dheerajkukreja4269 Жыл бұрын
How are you printing the response status and latency in terminal....please reply
@longnguyenthanh6876
@longnguyenthanh6876 3 жыл бұрын
thanks
@gasacchi6734
@gasacchi6734 3 жыл бұрын
Maybe you can run the benchmark on your local machine, so VPS doesn't allocate ram for running benchmark, btw nice video ❤️
@Cdswjp
@Cdswjp 2 жыл бұрын
Would that be a bad idea resulting in inaccurate test results because the local environment does use the same hardware configurations as the VPS…. Or does it…? 🤔
@adityasethi9794
@adityasethi9794 7 ай бұрын
nodejs is not single threaded. Hate it when people make such vids pretending they know it fully. JS is single threaded. Nodejs is not a language, it is a runtime. it makes use of threads too.
@kanehooper00
@kanehooper00 5 ай бұрын
Yes totally agreed. The tool being shown at the beginning is for browser runtimes and not Node.js runtime. The benchmarking is fine but the fundamental understanding of Node is not quite right.
@electrolyteorb
@electrolyteorb Ай бұрын
Well kiddo... It's like saying Pi is NOT 22/7, "iTS irrAtionAl nUMBERRR" We know GC requires multiple threads... That doesn't change the fact JS has horrible performance
@kabali_da129
@kabali_da129 16 күн бұрын
As per my knowledge, when a blocking request is written asynchronously, that request is assigned to the thread pool (place where all threads present), this is where multi threaded capability is achieved by assigning the asynchronous requests to the threads available in the thread pool.. if there's any mistake or my way of understanding is wrong, please correct me.
@tyongalves7129
@tyongalves7129 8 ай бұрын
bruv thanks so much
@JohnDoe-ji1zv
@JohnDoe-ji1zv 2 жыл бұрын
When you ran benchmark on your server and local machine you were actually utilising only 1 core of the CPU. Would be much better if you scale node at least with pm2 on local machine and VPS as well, then results would be slightly better.
@Cdswjp
@Cdswjp 2 жыл бұрын
Good catch. How were u able to notice that?
@JohnDoe-ji1zv
@JohnDoe-ji1zv 2 жыл бұрын
@@Cdswjp by default node is running on only 1 core, so to scale node you need to create an instance per core
@soniablanche5672
@soniablanche5672 Жыл бұрын
you can also use cluster to have multiple express apps running on a different core
@AyushKumar-te7jn
@AyushKumar-te7jn Жыл бұрын
@@soniablanche5672 pm2 is far better and easier
@mohamedelsayed1868
@mohamedelsayed1868 11 ай бұрын
pm2 + worker threads
@soniablanche5672
@soniablanche5672 Жыл бұрын
what about clustering to make use of multiple cores
@dinoscheidt
@dinoscheidt Жыл бұрын
Much better to do this on the system layer. Aka: Typical are 1 core docker containers. Then auto scale the nodes with kubernetes.
@KuroManX
@KuroManX Жыл бұрын
@@dinoscheidt just run pm2
@sumitsharma5946
@sumitsharma5946 2 жыл бұрын
Shouldn't you run benchmark on your server(Sever api endpoint) from your local machine instead of logging in to ssh?
@soniablanche5672
@soniablanche5672 Жыл бұрын
it will probably cost him a lot if he pays by request for the VPS lol
@hanimecheddal6472
@hanimecheddal6472 3 жыл бұрын
😍😍
@teetanrobotics5363
@teetanrobotics5363 2 жыл бұрын
Could you please make 2 playlists for: 1) nodejs tutorials 2) react/nextjs tutorials ? Amazing content. thank you
@kokizzu
@kokizzu 2 жыл бұрын
hail golang :3
@7heMech
@7heMech Жыл бұрын
Would be good if you use multiple threads.
@Dev-Siri
@Dev-Siri Жыл бұрын
Fastify would have actually performed better instead of express. Its about 3x faster than express so it would have been a better fit for this video.
@hijazi479
@hijazi479 Жыл бұрын
well, most of the time it's the database that causes errors or timeouts.
@pbdivyesh
@pbdivyesh 10 ай бұрын
I don't know why, but somehow I could not understand anything in this. PS I have 7 YOE.
@vipsvips3213
@vipsvips3213 Ай бұрын
O(n!) not O(log n) Fibonacci
@jessestackhom5607
@jessestackhom5607 Жыл бұрын
The only thing better than this video is making money in cryptocurrency.
@daksmemes7428
@daksmemes7428 2 жыл бұрын
I think jmeter is better
Is TypeScript (NodeJS) Faster than Go?? |  A server comparison
9:54
ThePrimeagen
Рет қаралды 217 М.
Playing hide and seek with my dog 🐶
00:25
Zach King
Рет қаралды 36 МЛН
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 126 МЛН
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 226 М.
PROOF JavaScript is a Multi-Threaded language
8:21
Beyond Fireship
Рет қаралды 272 М.
Concurrency vs Parallelism in Node.js
7:47
Mehul - Codedamn
Рет қаралды 41 М.
I built a $5 chat app with Pocketbase & Svelte. Will it scale?
13:34
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 638 М.
How to scale NodeJs applications using the cluster module.
13:37
Mafia Codes
Рет қаралды 50 М.
Managing The Event Loop Phases ⭕️ | OPTIMIZING NODE JS
23:32
Bleeding Code (By John Jardin)
Рет қаралды 18 М.
Testing Node Server with Jest and Supertest
11:45
Sam Meech-Ward
Рет қаралды 114 М.
How to use Multithreading with "worker threads" in Node.js?
19:34
Software Developer Diaries
Рет қаралды 55 М.