Building a nonblocking multiprocesses Web Server Node JS fork example











>> YOUR LINK HERE: ___ http://youtube.com/watch?v=hmTl5Y4ee_Y

If you build a backend such as a web server you need to account for requests that will yield expensive processing. Expensive requests will block other requests from being served if you only have a single process or thread for execution. This is when you might want to spin another process to execute your requests leaving the main process free to receive requests. In this video we will build a multi-process non-blocking web server using node js by forking incoming requests into their own processes for execution while keeping the main process free. We also explain the pros and cons of doing so, since it might not be always a good idea to create multiple processes as it increases the complexity of your application. • Building ‘isPrime’ web service • Some testing prime numbers • 2367949 (16 ms) • 43686389 (200 ms) • 93686687 (500 ms) • 936868033(4 seconds) • 29355126551 (doesn’t finish) • • Source Code • isprime (blocking) • https://github.com/hnasr/javascript_p... • isprime (non-blocking) • https://github.com/hnasr/javascript_p... • • Jump code • Blocking Single Process 2:40 • Non-Blocking Single Process 6:10 • Pros Cons 17:00 • • Pros • Non-blocking • utilizes the multi-core CPUs • De-coupling • Cons • Complex • You Won’t be able to debug • little challenging to know how long the client has been waiting since we are not measuring that on the server • Health Checking Messaging between processes, orphan processes, crashed processes • • Cards • 4:15 Query parameters • • Support me on PayPal https://bit.ly/33ENps4 • Become A Patron   / hnasr   • Stay Awesome! • Hussein

#############################









New on site
Content Report
Youtor.org / YTube video Downloader © 2025

created by www.youtor.org