Load Balancing with NGINX

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024

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

  • @durubalastefan7369
    @durubalastefan7369 6 ปีที่แล้ว +18

    This is the best tutorial that I've seen in a long long time, Thank You !!

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

    Awesome how to for NodeJS Microarchitecture and load balancing. Those were advanced topics broken down into bite sized comprehensible chunks .

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

    This is a great tutorial. Short, sweet and to the point ☝️

  • @hnasr
    @hnasr 6 ปีที่แล้ว

    I went to the original nginx blog and they didn't do a good job explaining their technology the way you did. well done sir!

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

    I like the way you explain things

  • @IanCristopherBuena
    @IanCristopherBuena 7 ปีที่แล้ว +15

    Keep them coming Juriy. Good work!

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

      I guess im randomly asking but does someone know a tool to log back into an instagram account?
      I was stupid forgot my account password. I would appreciate any tricks you can offer me!

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

      @Zahir Byron Instablaster =)

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

      @Weston Genesis Thanks for your reply. I got to the site on google and I'm trying it out now.
      I see it takes quite some time so I will reply here later with my results.

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

      @Weston Genesis it worked and I finally got access to my account again. I'm so happy:D
      Thanks so much you saved my ass :D

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

      @Zahir Byron Happy to help :D

  • @hankchanocd
    @hankchanocd 5 ปีที่แล้ว

    This is by far the best tutorial on load balancing

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

    Thanks Juriy! This series helped me deploy to AWS!

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

    I’m sorry, I’m two minutes in and this is honestly a fantastic video in content and presentation, but I can’t help but be reminded by the accent of the old “End of the World” flash animation from like 2003 🤣

    • @JuriyBura
      @JuriyBura  5 ปีที่แล้ว

      Oh man :) That's just as far as I could get rid of my east-European accent. Gotta practice more somewhere in pubs of New York :)

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

    Helped out a ton for some of my recent work. Thanks Brad!

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

    Nice nice, guy! Keep going with more very explained videos like that...

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

    Damn this is awesome, thanks I totaly understand loadbalancing in Nodejs now :)

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

    Wow! This is explained extremely well! I really appreciate it!

  • @majidrahimi1965
    @majidrahimi1965 6 ปีที่แล้ว +4

    Juriy Bura
    Great tutorial, Thank you so much.
    Are you going to add more video about this topic?

  • @masterj1081
    @masterj1081 4 หลายเดือนก่อน

    Great tutorial , Thank you so much sir.

  • @pratika-prakhar
    @pratika-prakhar 5 ปีที่แล้ว +4

    Firstly thank you so much to post the really help full videos,
    I was looking for Zero down time deployment, can you please share that video link here...
    Thanks,
    Prasenjit

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

    These videos are fantastic! Thanks a lot!! Looking forward to more.

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

    Watched half the video with the feeling "I could do that with only pm2" (running it in cluster mode). I suppose the point here is to demonstrate doing LB with nginx. Really helpful videos though, keep it coming.

    • @JuriyBura
      @JuriyBura  7 ปีที่แล้ว +3

      Thanks! You're right, what you see here can be accomplished with just PM2. The reason to make this "preparing" steps and making NGINX load-balance Node apps instead of PM2 cluster is to then move to green/blue deployments and a bit more advanced zero-downtime redeploys.

  • @yajatvishwakk6744
    @yajatvishwakk6744 4 ปีที่แล้ว

    Can't thank you enough for this.

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

    nice and clear tutorial

  • @ritahart2249
    @ritahart2249 6 ปีที่แล้ว

    To get the project into the sample state use the commands
    git reset --hard
    git checkout task-clean-db
    Once completing the task enter the Test ID idb-clean

  • @DeveloperTharun
    @DeveloperTharun 4 ปีที่แล้ว

    amazing series. thank you

  • @llagos
    @llagos 5 ปีที่แล้ว

    I saw failover but I didn't see load balancing... or am I mistaken? I expected to see easy-1, then easy-2, then again easy-1, etc. And even more, a test with some kind of "cpu eater" on easy-1 would be nice... so we could see all going exclusively to easy-2 during those moment, and then go back to alternate between 1 and 2... thanks!

  • @AmitGuptaGwl
    @AmitGuptaGwl 5 ปีที่แล้ว

    Probably not related to but 1 question. Why the memory usage for both instances are different: 29.8MB, 9.6MB

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

    Thanks for sharing, Juriy! Helped me a lot!

  • @papalevies
    @papalevies 7 ปีที่แล้ว +4

    Excellent series Juriy! Do you have any tips on securing your production web server (firewall config etc)?

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

      Here some production nginx configurations that may be useful: www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html

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

      You are right, there are few things to do for production. I would enable SELinux and FirewallD (both disabled by default in DO distro) and also add several options to nginx. This link might also be useful. gist.github.com/plentz/6737338 Finally, I would check my website with Mozilla Observatory observatory.mozilla.org/

  • @ribarmilos
    @ribarmilos 6 ปีที่แล้ว

    I have an application that handles http as well as WebSockets. Angular Application is connecting to this server.
    WebSocket connection is at [someIp]:[someport]/websocket/connect
    Should I configure my upstream to target this url?
    Also, should I target the Ngnix in my WebSocket configuration?

  • @AndreaNobili84
    @AndreaNobili84 4 ปีที่แล้ว

    Fantastic job man !! Only a question: is it related to NGINX Plus or NGINX Community Edition? The ip_hash directive works also in the Community edition? Thanks a lot !!!

    • @JuriyBura
      @JuriyBura  4 ปีที่แล้ว

      All these was in free community edition.

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

    Awesome series!

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

    nice work - great explanation

  • @lodbp3363
    @lodbp3363 4 ปีที่แล้ว

    i was looking for zero down time deployment that you mentioned. could you share with us too? many thanks , i learned alot from your videos !

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

      Lollloll Koko Zero-downtime, we are *almost* there ;) I think 3-4 more vids and we’ll be able to set it up.

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

    I have implemented as you said in the tutorial but i am getting ssl_stapling error.PLease give me the solution

  • @joakimjohansson7729
    @joakimjohansson7729 6 ปีที่แล้ว

    Awesome video man!

  • @Hellmiauz
    @Hellmiauz 4 ปีที่แล้ว

    So, what keeps 2 servers behind a load balancer in sync? If i connect to 1 via web app and make a change to the files(not the database) does the change also happen on the others servers automatically?

    • @JuriyBura
      @JuriyBura  4 ปีที่แล้ว

      EmuBench no, your applications will have to make sure that your resources are in sync. For example, instead of saving files locally, better save them in something like S3.

  • @amit.a
    @amit.a 7 ปีที่แล้ว +1

    great series! are you planning to create a tutorial on automation, setting up everything with ansible and deploying from git? thanks again for this series!

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

      Yes, although I made a short break with this series I definitely plan to move to more advanced subjects and record 6-7 more vids.

    • @amit.a
      @amit.a 7 ปีที่แล้ว

      thanks, looking forward to it!

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

    great video

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

    Just found this video, awesome! (y) put full video series to my download list :)
    Can you explain what's the difference between using clustering(pm2 start app.js -i 2)vs nginx load balance. (Let's say I'm deploying this application on a 8core server and run as 8 clusters)
    Edit:
    If I'm only using a one server, just using clustering is fine, right?

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

    Thanks so much!

  • @Karimdjerbien
    @Karimdjerbien 4 ปีที่แล้ว

    great job

  • @anilkinikar
    @anilkinikar 4 ปีที่แล้ว

    Please explain how can load balancing strategy in NGINX. If there are too many connections on node1 how it sends new requests to n
    node2

  • @jeyraj3075
    @jeyraj3075 5 ปีที่แล้ว

    I am using socket.io with NodeJS. So I have declared ip_hash in nginx upstream. But all my requests are hitting single server only. Kindly suggest some idea to achieve load balancing with sticky session.

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

    Excellent video, but i have a question, you said that websocket handshake is a multistep process.I was reading the RFC and from what i've learnt is that client sends an HTTP get request with 'upgrade' header and server responds with an HTTP response of '101 Switching Protocols' and the handshake is completed, doesn't that make websocket handshake a single step process? and can you please explain exactly what steps and how many requests and responses are sent to-and-from the server and client?

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

      Handshake is the first step and the actual connection is the second. I used the wrong wording here. So if server A gets the handshake and then server B gets the connection, this is where you may have a problem if load balancing is not set properly.

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

      can you please explain the actual connection process of websocket or refer me some resources to learn more about this connection process of websocket?
      thanks for the reply though.

  • @g-luu
    @g-luu 4 ปีที่แล้ว

    Superb. Keep it up.

  • @lotfikamel5947
    @lotfikamel5947 4 ปีที่แล้ว

    You can pm2 directly to load balanci g

    • @JuriyBura
      @JuriyBura  4 ปีที่แล้ว

      lotfi kamel yes, but it is using node’s internal inter-process communication to do that. It is generally considered a better choice to go with nginx or HAProxy.

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

    Hey, great video! Are you going to record smth. related to a docker deployment?

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

      Thanks for suggestions. I got that in plans, but Docker is a whole different world of tools and techniques. I definitely plan to show how to "dockerise" and run Node app, but more complex docker deployments and orchestration would be a good subject for a separate series.

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

    Is there a tutorial for setting up load balancing and different node servers?

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

    I tell pm2 run listen on port 8081, but it only run on port 8080 that i config in my app.js, so how can i make pm2 run my app on other port?

  • @ehsankhorasani_
    @ehsankhorasani_ 5 ปีที่แล้ว

    when you pass the port by argument how main.js take it. by env variable?

  • @HaHa16760
    @HaHa16760 5 ปีที่แล้ว

    Hello Awesome Video !!! i would like to know if nginx load balancer exists on open source version

  • @yadegaSabre
    @yadegaSabre 6 ปีที่แล้ว

    Great job !

  • @cenubit
    @cenubit 4 ปีที่แล้ว

    The PM2 works in Ubuntu ?

  • @IanCristopherBuena
    @IanCristopherBuena 6 ปีที่แล้ว

    Do you still plan to continue this series?

  • @ПетроКобзар
    @ПетроКобзар 6 ปีที่แล้ว

    "Error: listen EADDRINUSE :::8080" в логе pm2. Получается я запускаю на порте 8081 хотя порт в програме стоит 8080. Как исправить ситуацию?

  • @Fexik2000
    @Fexik2000 6 ปีที่แล้ว

    How to make the same color scheme for Vim on the mac? Thanks.

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

    Hi Juriy,
    Good explanation can you please share any link to configure basic loadbalancing in NGINX for Ubuntu OS
    Thanks

  • @akshatchaturvedi3642
    @akshatchaturvedi3642 4 ปีที่แล้ว

    Can somebody please help me on how to run multiple instances of the same application on localhost ??

  • @meharsingh9725
    @meharsingh9725 6 ปีที่แล้ว

    I have been searching for pm2 on multi-core CPU demo with sticky session. Please some knows any video on this, do comment. Thanks

  • @mrbassocam
    @mrbassocam 5 ปีที่แล้ว

    Nice video

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

    Please do a zerodowntine redeploys

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

      That exact video is planned and I think in couple of weeks I will release it :)

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

      Hey Juriy,
      The playlist was very informative, waiting for the zero downtime redeploy video!

    • @kengresify
      @kengresify 5 ปีที่แล้ว

      @@JuriyBura thank you so much Juriy. Waiting for zero downtime redeploy video. thanks

  • @sonalkumarsingh4659
    @sonalkumarsingh4659 6 ปีที่แล้ว

    What is ideal requirement for "NGINX" SERVER ??

    • @JuriyBura
      @JuriyBura  6 ปีที่แล้ว

      I'm not sure I got your question, you're talking about minimal system requirements?

    • @sonalkumarsingh4659
      @sonalkumarsingh4659 6 ปีที่แล้ว

      yes indeed I'm asking that what is the minimal system requirement for nginx server as load balancer that can handle two node js server 4 core each two of them ?

    • @JuriyBura
      @JuriyBura  6 ปีที่แล้ว

      Nginx itself has extremely low requirements, it is very unlikely that it will be a bottleneck in your system. I couldn't find exact numbers, but so far I never had issues running nginx even on smallest cloud instances and on cheapest servers.
      Unfortunately I couldn't find the exact requirements, but they will probably depend on the modules and exact configuration that you're going to use.

    • @JuriyBura
      @JuriyBura  6 ปีที่แล้ว

      After googling some more time, I found this document on nginx website:
      cdn-1.wp.nginx.com/wp-content/files/nginx-pdfs/Sizing-Guide-for-Deploying-NGINX-on-Bare-Metal-Servers.pdf
      It says that on a $750 server nginx should be able to handle 90k requests per second.

    • @sonalkumarsingh4659
      @sonalkumarsingh4659 6 ปีที่แล้ว

      Thank you, I highly appreciate your help. And the pdf link is really very helpfull

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

    More about server programming

    • @JuriyBura
      @JuriyBura  6 ปีที่แล้ว

      Thanks for suggestion! Check out these two webinars that I recorded about Node.js development:
      th-cam.com/video/IwuQcMP2m4E/w-d-xo.html
      th-cam.com/video/MBMNmtyZQ9s/w-d-xo.html

  • @Magnet_Computers
    @Magnet_Computers 6 ปีที่แล้ว

    Hi juriy Bura.!

  • @user-bv4vw3uh6h
    @user-bv4vw3uh6h 4 ปีที่แล้ว

    github link??)

  • @nagcvlogs
    @nagcvlogs 4 ปีที่แล้ว

    THE JESUS.....

  • @rajshrishrimal2653
    @rajshrishrimal2653 4 ปีที่แล้ว

    Hiii

  • @undercrackers56
    @undercrackers56 4 ปีที่แล้ว

    What is this new trend to edit the narrative so fast. It's like a 70's radio DJ on speed. The human brain needs pauses between sentences to absorb information.

  • @RagazzoKZ
    @RagazzoKZ 5 ปีที่แล้ว

    Акцент режет слух

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

      А коммент - режет глаз :)

    • @kengresify
      @kengresify 5 ปีที่แล้ว

      @@JuriyBura your accent is awesome!

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

    2022 update
    $ nginx -t # to test the config if ok
    $ nginx -s reload # send reload signal to nginx