NGINX Internal Architecture - Workers

  Рет қаралды 43,700

Hussein Nasser

Жыл бұрын

In this video I explain the NGINX internal process architecture, how NGINX spins up multiple processes per core, how each process is pinned to a CPU core for minimum context switching, how NGINX accepts connections , parses requests and talks to the backend.
Get my introduction to NGINX udemy course
nginx.husseinnasser.com
Fundamentals of Networking for Effective Backends udemy course (link redirects to udemy with coupon)
network.husseinnasser.com
Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)
database.husseinnasser.com
Introduction to NGINX (link redirects to udemy with coupon)
nginx.husseinnasser.com
Python on the Backend (link redirects to udemy with coupon)
python.husseinnasser.com
Become a Member on KZfaq
kzfaq.info/love/_ML5xP23TOWKUcc-oAE_Egjoin
Buy me a coffee if you liked this
www.buymeacoffee.com/hnasr
Arabic Software Engineering Channel
kzfaq.info/love/hWZsjdoRvZ0T9QWZOD6UpA
🔥 Members Only Content
kzfaq.info/sun/UUMO_ML5xP23TOWKUcc-oAE_Eg
🏭 Backend Engineering Videos in Order
backend.husseinnasser.com
💾 Database Engineering Videos
kzfaq.info/sun/PLQnljOFTspQXjD0HOzN7P2tgzu7scWpl2
🎙️Listen to the Backend Engineering Podcast
husseinnasser.com/podcast
Gears and tools used on the Channel (affiliates)
🖼️ Slides and Thumbnail Design
Canva
partner.canva.com/c/2766475/647168/10068
Stay Awesome,
Hussein

Пікірлер: 33
@hnasr
@hnasr Жыл бұрын
Get my introduction to NGINX udemy course nginx.husseinnasser.com
@RajnishAhuja
@RajnishAhuja Жыл бұрын
Hussein, Do you have a course on istio and certificate management ( By you or somebody you respect ) ?
@shubhamdhal689
@shubhamdhal689 Жыл бұрын
First Comment on a Hussein Nasser vid :) One thing to note is how fast KZfaq is able to serve the video in my feed. I think I started watching this almost as soon as Hussein uploaded the video(it was saying zero views, but ofcourse that counter is eventually consistent and is cached at multiple layers). KZfaq recommendations is truly a feat of engineering
@tempaccount8256
@tempaccount8256 Жыл бұрын
Hussein, your contents are always awesome, with a lot of information. I was wondering if you can tell us about your past experiences and how you get to the place you're now, and also what's your current stack? And more😁😁, We will be lucky😅
@franpereyra5459
@franpereyra5459 Жыл бұрын
It would be great to see an explanation like this, about Apache web server, in order to understand the main differences with Nginx (pros and cons). Amazing explanation, thank you!
@hnasr
@hnasr Жыл бұрын
Great idea
@nikhilsinghal1315
@nikhilsinghal1315 Жыл бұрын
I work on nginx modules a lot. You should also discuss the moduler way of adding new code in nginx. The code architecture of nginx is pretty neat.
@rio512hsu
@rio512hsu Жыл бұрын
Any good reading material recommended?
@blevenzon
@blevenzon Жыл бұрын
Thank you for the clear and concise explanation 😊
@nickkman90
@nickkman90 11 ай бұрын
Fabulous lecture! Thanks Hussein.
@krishnamohanyerrabilli4040
@krishnamohanyerrabilli4040 Жыл бұрын
👏 thanks for this, clearly understood what's happening behind the scenes
@shreemaan-abhishek
@shreemaan-abhishek Жыл бұрын
Oh hey!
@habibicoding
@habibicoding Жыл бұрын
Very interesting, good job, shater/شاطر!
@TylerRake141
@TylerRake141 Жыл бұрын
I would love to watch more stuff like these, it could be a series like e.g. IIS, Apache architecture etc
@thescubabuba6470
@thescubabuba6470 Жыл бұрын
Is there a way to calculate how many connections a worker can handle simultaneously?
@hnasr
@hnasr Жыл бұрын
I think this is a very good question and needs low level kernel level and logging to see how much latency is added with 1 , 2 and 3 and then 4 threads. And then seeing how many requests can be processed with each configuration
@achrefnabil2463
@achrefnabil2463 Жыл бұрын
I think if you wanna calculate the maximum number of connections per worker process you should divide the system file descriptor limit by the number of worker processes. For example, if the file descriptor limit is 1024 and there are 4 worker processes each worker process can handle up to 256 connections simultaneously
@manojBadam
@manojBadam Жыл бұрын
How does file descriptors come into picture for handling more connections?
@KuldeepYadav-jn3ld
@KuldeepYadav-jn3ld Жыл бұрын
Could you please have a small session about Public Suffix List ?
@rehaanmazid2435
@rehaanmazid2435 Жыл бұрын
Hey @Hussien, When a NGINX server is set up in docker. What happens to the worker process and core mapping? I assume it will not map to the host machines cpu cores. What happens in this case?
@SB-qm5wg
@SB-qm5wg Жыл бұрын
nginx is one of those things I've barely admin'ed at jobs but never put time in to master.
@mohammedabulsoud1819
@mohammedabulsoud1819 Жыл бұрын
so goood
@AjithkumarSekar
@AjithkumarSekar Жыл бұрын
This is great. Can you also talk about CGI (Common Gateway Interface) and why we need it?
@faizsyed658
@faizsyed658 Жыл бұрын
Do you want internal architecture of CGI? If you just wanna better understand about cgi, there are many good videos from other channels already
@TylerJusCodes
@TylerJusCodes Жыл бұрын
Hey .. long time my friend. been awhile I visited here.
@dimtass
@dimtass Жыл бұрын
A good strategy, especially to bare metal embedded servers is to use SMP IRQ affinity and map the netif IRQ to a single core. Then only use the rest cores to handle requests. This will improve the performance a lot.
@seanknowles9985
@seanknowles9985 Жыл бұрын
How to build a http3 client, I am struggling to get my head around why some http libraries are still http1 and why they've not been updated? (this could be interesting content)!
@raghavgupta1799
@raghavgupta1799 Жыл бұрын
This topic should be in the Indian Engineering courses as a separate subject.
@abelsimon5308
@abelsimon5308 Жыл бұрын
planning a course on envoy as well? (have seen your TL-DR about the proxy)
@hnasr
@hnasr Жыл бұрын
made a video on envoy but im not satisfied with it. need to redo it.
@abelsimon5308
@abelsimon5308 Жыл бұрын
​@@hnasr maybe a udemy course if you fancy would be even better I've thoroughly enjoyed the nginx one. It does also help with the bigger picture when having multiple layers of proxies. E.g a project I'm working on right now, we're having an HA proxy and two envoys for egress. (one sidecar with custom listeners set up for port forwarding, and one egress in a DMZ to fulfil these forwards)
@KhanKhan-ym4mo
@KhanKhan-ym4mo Жыл бұрын
u shud take some presentation / communication skills training, ur videos are very monotonous and uninteresting, despite having valuable content. i hope you will take it positively and improve urself.