How HTTP/2 Works, Performance, Pros & Cons and More

Ғылым және технология

HTTP/2 or H2 for short is a major revision of the hyper text transfer protocol that improves the performance of the web. It uses a binary protocol and multiplexing.
HTTP/2 (Slides)
payhip.com/b/E37AG
(Members get all slides for free. Become a Member to support the channel)
/ @hnasr
Time codes
0:00 Intro
2:15 HTTP 1.1
5:50 HTTP/2
8/25 HTTP/2 With Push
9:48 HTTP/2 Pros
14:10 HTTP/2 Cons
17:15 Demo
In this video I want to go through how HTTP/2 works, its pros and cons and show the performance difference between HTTP 1.1 and HTTP/2
Http/1
request has to wait for a response
And if you used up your connection response you can send anything else.
Source Code: github.com/hnasr/javascript_p...
So hack !
6 tcp connections
Pros
One connection
Multipex
Push ( have to enable)
Hpack (compress)
Cons
Abuse push
Proxies that dont support it might slow down
Load balancer layer 7 (a layer 7 load balancer that doesnt support h2 will slow down when your web server supports it)
+----------+--------+---------+---------+
| Protocol | Online | Fast 3G | Slow 3G |
+----------+--------+---------+---------+
| HTTP 1.1 | 94 ms | 10 s | 36 s |
+----------+--------+---------+---------+
| HTTP/2 | 171 ms | 2.7 s | 10 s |
+----------+--------+---------+---------+
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 KZread
/ @hnasr
Arabic Software Engineering Channel
/ @husseinnasser
🔥 Members Only Content
• Members-only videos
🏭 Software Architecture Videos
• Software Architecture
💾 Database Engineering Videos
• Database Engineering
🛰 Network Engineering Videos
• Network Engineering
🏰 Load Balancing and Proxies Videos
• Proxies
🐘 Postgres Videos
• PostgresSQL
🧮 Programming Pattern Videos
• Programming Patterns
🛡 Web Security Videos
• Web Security
🦠 HTTP Videos
• HTTP
🐍 Python Videos
• Python by Example
🔆 Javascript Videos
• Javascript by Example
Support me on PayPal
bit.ly/33ENps4
Become a Patreon
/ hnasr
Stay Awesome,
Hussein

Пікірлер: 126

  • @hnasr
    @hnasr2 жыл бұрын

    Get my Fundamentals of Networking for Effective Backends udemy course Head to network.husseinnasser.com for a discount coupon (link redirects to udemy with coupon applied)

  • @allisonmachado
    @allisonmachado3 жыл бұрын

    Netflix for developers :)

  • @hnasr

    @hnasr

    3 жыл бұрын

    ❤️

  • @ScarzChosenspokesmen

    @ScarzChosenspokesmen

    3 жыл бұрын

    LOL great comment

  • @nadertarek4822

    @nadertarek4822

    2 жыл бұрын

    HAHA! literally

  • @andile5945

    @andile5945

    2 жыл бұрын

    And you don’t have to use someone else’s account

  • @nateengedal7939

    @nateengedal7939

    Жыл бұрын

    hard pass on the chill

  • @whereismypipey
    @whereismypipey4 жыл бұрын

    I loved the picture grid loading example to nicely visualize the performance and difference in number of connections.

  • @dean6046
    @dean60464 жыл бұрын

    thank you Hussein! I want you to understand that this is great content and I love the way you deliver it with such energy and excitement. I frequently download videos from KZread for offline use and I just downloaded this one because I think it's great content.

  • @umeshshetty0605
    @umeshshetty0605 Жыл бұрын

    I am a Network Engineer but I love the backend Engineering stuff that you show and it makes it easier for me to understand application problems while troubleshooting the network side of it. Thank You and Keep posting !!!

  • @hnasr

    @hnasr

    Жыл бұрын

    Thanks!! Glad to see more network engineers in the channel. Cheers

  • @balramverma4873
    @balramverma48732 жыл бұрын

    This channel is to addictive that even in the period I’m focusing on front end stuff i end up watching these.

  • @amsterdenko9854
    @amsterdenko98542 жыл бұрын

    First time on your channel. Subscribed after this first video. I like your style of content delivery. Such a themes become much more entertantaining. Thank You!

  • @omriterem6448
    @omriterem64484 жыл бұрын

    One of the best KZread channels for programmers...

  • @mohamad5497
    @mohamad54973 жыл бұрын

    Your content is great! Thanks Hussein!

  • @SatishKumar-jb9qm
    @SatishKumar-jb9qm3 жыл бұрын

    Your content is great! Thank you for posting.

  • @subhamthemusicalguy8851
    @subhamthemusicalguy88514 жыл бұрын

    Joined your channel to support you. Excellent work

  • @hnasr

    @hnasr

    4 жыл бұрын

    ❤️ thanks Subham ! Appreciate your support

  • @rahulmalu6741
    @rahulmalu67414 жыл бұрын

    Hi @husseon Nassar: In the demo for http2, did you used the server push mechanism to push the 100 images or only the protocol was set to http2 (without enabling the server push)?

  • @mageshp5998
    @mageshp59984 жыл бұрын

    Liked your demo!!

  • @SateeshBandi
    @SateeshBandi4 жыл бұрын

    Very good demo.. I loved it.

  • @amrudeshs
    @amrudeshs4 жыл бұрын

    Hei. Great info. Thnx. Can you also make a comparison between HTTP2 server push and Websockets based push messages? I understand that they dont serve the same purposes but a short video on it explaining when to use what would be great.

  • @romantsyupryk3009
    @romantsyupryk30094 жыл бұрын

    Thanks so much for this video tutorial.

  • @oah8465
    @oah84653 жыл бұрын

    More reasons to love. L4 LBs. Thx Hussein.

  • @user-fm7kj3li2w
    @user-fm7kj3li2w4 жыл бұрын

    excellent!! very clear provocation and easy to understand.

  • @hnasr

    @hnasr

    4 жыл бұрын

    Thank you 🙏

  • @natarajboina7525
    @natarajboina75253 жыл бұрын

    This was very insightful. Thanks for this video.

  • @hnasr

    @hnasr

    3 жыл бұрын

    Thanks for your comment Nataraj

  • @smohammadhn
    @smohammadhn2 жыл бұрын

    Fantastic explanation, loved it

  • @andikakurniawan4188
    @andikakurniawan41882 жыл бұрын

    I like this guy. This guy is smart and also have talent to be teacher...

  • @ankitsah2819
    @ankitsah28194 жыл бұрын

    Awesome explanation 👍🏻

  • @zitro7052
    @zitro70523 жыл бұрын

    Im in education as IT-Specialist - System Integration right now, third year and almost finished my Project. My Teachers couldnt teach us normal OSI model or SQL, we never had HTML in school. imagine you doin this just in your free time and you are more meaningfull as much Teachers in germanys working schools for myself and some friends. Thanks for that little snack, i just wanna set up an HTTP 2 server now :D! should i go for nginx or more for something like apache?

  • @Esmi_here
    @Esmi_here8 ай бұрын

    It was so fun watching!!

  • @kaleemullah247
    @kaleemullah247 Жыл бұрын

    Loved the demo.

  • @danielkrajnik3817
    @danielkrajnik38173 жыл бұрын

    the more I learn about software, the more I find that every next upgrade boils down to parallelization

  • @hozay6552
    @hozay65522 жыл бұрын

    So many advances for the internet that I was not aware of!

  • @Lucasmont001
    @Lucasmont0014 жыл бұрын

    excellent video! Thanks! ;)

  • @fraollemecha
    @fraollemecha2 жыл бұрын

    HTTP/2: We gotta do it fast. Michael Scott: That's what she said.

  • @longtranbao4177
    @longtranbao41772 жыл бұрын

    Thanks you! In school people don't teach about this stuff.

  • @romantsyupryk3009
    @romantsyupryk30094 жыл бұрын

    Amazing demo HTTP/1.1 and HTTP/2.0 Thanks you very very very much.

  • @hnasr

    @hnasr

    4 жыл бұрын

    thanks Roman for all the love and comments!!!

  • @romantsyupryk3009

    @romantsyupryk3009

    4 жыл бұрын

    @@hnasr 😃😉

  • @TimothyNyota
    @TimothyNyota2 жыл бұрын

    Subscribed!! Great content, man!!

  • @bharat639
    @bharat6394 жыл бұрын

    I have watched a lot of your videos. Thank you very much for sharing your knowledge.

  • @shubhampawar2207
    @shubhampawar22074 жыл бұрын

    Awesome Presentation!...

  • @hnasr

    @hnasr

    4 жыл бұрын

    😊🙏 thanks

  • @GauravJain108
    @GauravJain1083 жыл бұрын

    Thanks, Hussein! :)

  • @devashishrana1637
    @devashishrana16373 жыл бұрын

    Suppose my configuration is client -> gateway -> server, how will http2 behave in this scenario between each layer?? or should I just keep only client and gateway in http2?

  • @AwesomeMetalBands
    @AwesomeMetalBands3 жыл бұрын

    Seriously great content very very interesting!!@

  • @AnilSharma-gr6ck
    @AnilSharma-gr6ck2 жыл бұрын

    very good , thanks

  • @abnan0001
    @abnan00014 жыл бұрын

    I checked again brother Is there any update for the series

  • @sreevishal2223
    @sreevishal22234 жыл бұрын

    michael scott..! , that's what she said.. haha :p :p Nice explanation..!

  • @chenrvn
    @chenrvn4 жыл бұрын

    1. Thanks, Gr8 video 2. It will be helpful if u will show the stream Ids in the http request/response and the TLS connection mechanism 😎

  • @hnasr

    @hnasr

    4 жыл бұрын

    Thanks Chen! That is a great idea diving deep into the belly of the beast of HTTP/2.. will consider it in the future.

  • @chenrvn

    @chenrvn

    4 жыл бұрын

    @@hnasr you are the men

  • @saumyapandey218
    @saumyapandey2182 жыл бұрын

    What happens when a file is already cached in the client but the server pushes the file because of its configuration?

  • @abdelrhmanahmed1378
    @abdelrhmanahmed13782 жыл бұрын

    does http2 also multiplex the segment inside each request or send them in sync and wait for each segment ack ?!

  • @venkateswarans1012
    @venkateswarans10123 жыл бұрын

    HTTP 2 resolves head of line blocking at application layer but in transport layer (TCP) it's still exist and Quic is trying something to achieve even on transport layer level.

  • @harshg2003
    @harshg20034 жыл бұрын

    How can I check if my web server supports Http/1.1 or H/2 or H/3? How can I force H1 and H2 on either client side or server side, if they supports both?

  • @hnasr

    @hnasr

    4 жыл бұрын

    Hey Harash, I recommend chrome dev tools. Good idea ill make a video on this

  • @Twerqt
    @Twerqt4 жыл бұрын

    Hey, that is a brilliant explanation. I have one question. How did you say at 18:40 that there are 6 TCP connections sending images in parallel .. I couldn't make it out from the video

  • @hnasr

    @hnasr

    4 жыл бұрын

    Siddartha Reddy Thanks 🙏 6 connections are opened in case of HTTP/1 In browsers i explain this here Why Browsers have 6 active TCP Connections for each website? kzread.info/dash/bejne/ip-mlNCmZri2fps.html

  • @flobbie87
    @flobbie873 жыл бұрын

    What, where does it say in the spec that i have to wait for the response to send another request? I hope no actual client does that.

  • @palaniappanrm6277
    @palaniappanrm62774 жыл бұрын

    How to host a server in local with HTTP/2 support? Does node http-server, apache tomcat support it?

  • @hnasr

    @hnasr

    4 жыл бұрын

    Palaniappan RM sure all of those support it! Check out this video where I show h2 on caddy because its the easiest Getting started with Caddy the HTTPS Web Server from scratch kzread.info/dash/bejne/pmiiw65_g8-ooLQ.html

  • @Tony-dp1rl
    @Tony-dp1rl Жыл бұрын

    Those CONs of HHTP/2 are certainly a stretch, given a server could return a HTML page with all sorts of unused assets in it anyway which effectively creates a PUSH in terms of network load ... and the chances of having a H1 load balancer and H2 backend are almost zero.

  • @PouriyaJamshidi
    @PouriyaJamshidi4 жыл бұрын

    cURL supports HTTP/3 (experimental) as well.

  • @hnasr

    @hnasr

    4 жыл бұрын

    Nice! Didn't know that, looks like I need to make a video about cURL, thanks !

  • @PouriyaJamshidi

    @PouriyaJamshidi

    4 жыл бұрын

    @@hnasr Thanks to you.

  • @jerweiyeoh7096
    @jerweiyeoh70963 жыл бұрын

    Awww yis, another 1k like Either there is an ongoing meme on the community of leaving the like counts at 999 and I'm screwing it, or I'm on fire! XD PS: Appreciate the explanations, both high level and low level.

  • @hnasr

    @hnasr

    3 жыл бұрын

    🙏🙏🙏

  • @raphaelkuttruf
    @raphaelkuttruf3 жыл бұрын

    great content :) how would i set up http2 in my backend network after a reverser proxy?

  • @arongulyas6096

    @arongulyas6096

    3 жыл бұрын

    HAproxy supports http/2

  • @hhellohhello
    @hhellohhello4 жыл бұрын

    Sorry, but whats the difference between keep alive header and multiplexing?

  • @hnasr

    @hnasr

    4 жыл бұрын

    hhellohhello no problem! the Keepalived header instructs the server to not immediately close the TCP connection after it is made so we continue send more data through it. This was available since http 1.1 Multiplexing is the ability to send multiple requests in parallel in that TCP connection. Something we couldn’t in http 1.1 and only available in http2

  • @45xtc
    @45xtc3 жыл бұрын

    Thank a lot Hussein.one question?for example clent says keep alive and server response not keep alive.what does it happen in tcp connection?client will try to re establish again with 3 way handshake?

  • @hnasr

    @hnasr

    3 жыл бұрын

    If the server doesn’t support keepalive (which I will be surprised if it doesn’t means it is so old its 1997 or prior) the connection will be terminated after the response will be created. In http/2 the connection will be always kept alived

  • @45xtc

    @45xtc

    3 жыл бұрын

    ​@@hnasr thank you very much for you great content that you offer us!keep going

  • @akashdeepbilkhu8076
    @akashdeepbilkhu8076 Жыл бұрын

    Amazing

  • @hazemabdelalim5432
    @hazemabdelalim54322 жыл бұрын

    The idea here , if the server and client keeps this connection open , isn't that some-kind of wasting resources ? if the client doesn't request anything , the server will still need to have maintain this connection even if the user doesn't use it , probably we can set a ttl to the open connection , so after that time with not being active , it will be closed

  • @treepiesinc1418
    @treepiesinc14184 жыл бұрын

    good. thanks.

  • @maheshkariya
    @maheshkariya3 жыл бұрын

    Thanks 🙏

  • @Shmancy_pants_69
    @Shmancy_pants_693 жыл бұрын

    Hey noob question, how did you run that test on the image? that was cool. Please reply :-)

  • @hnasr

    @hnasr

    3 жыл бұрын

    It was a Python script I found online stackoverflow.com/questions/5953373/how-to-split-image-into-multiple-pieces-in-python

  • @waagnermann
    @waagnermann Жыл бұрын

    when you showed benchmarks where it was written that there was 6 TCP connections? in network panel

  • @hnasr

    @hnasr

    Жыл бұрын

    From Google paper Popular Web browsers, including IE8 [2], Fire- fox 3 and Google’s Chrome, open up to six TCP connections per domain, partly to increase parallelism and avoid head-of- line blocking of independent HTTP requests/responses, but mostly to boost start-up performance when downloading a Web page. static.googleusercontent.com/media/research.google.com/en//pubs/archive/36640.pdf

  • @nabidulalam6956
    @nabidulalam69563 жыл бұрын

    powerful stuff :v

  • @shah5364
    @shah53642 жыл бұрын

    thanks

  • @Ranjith_P
    @Ranjith_P2 жыл бұрын

    Its a huge performance difference - thats what she said

  • @shavishvilitornike
    @shavishvilitornike2 жыл бұрын

    How do I become member of this channel?

  • @surendrasharma8238
    @surendrasharma82382 жыл бұрын

    not much learning. But still good for beginners.

  • @apoorvamishra5952
    @apoorvamishra59523 жыл бұрын

    how can we check if it's a 6 TCP connections in case of HTTP/1.1 in developers tool?

  • @hnasr

    @hnasr

    3 жыл бұрын

    ConnectionID, I illustrate this here kzread.info/dash/bejne/fnabyLWwiJetdKw.html

  • @apoorvamishra5952

    @apoorvamishra5952

    3 жыл бұрын

    @@hnasr cool thanks!

  • @ahsannasir6214
    @ahsannasir62143 жыл бұрын

    10:41 I see what you did there xD

  • 4 жыл бұрын

    What is difference HTTP1.1 persistent connection and H2 multiplexing?

  • @hnasr

    @hnasr

    4 жыл бұрын

    Both HTTP 1.1 and H2 have persisted connection. (They are not closed as long as requests are being sent) The difference is in H1.1 you can only send one request at a time and you can’t send another request until you get a response.. this is made slightly better with pipelining where you can send multiple requests in the same connection but the server must respond in order the requests where sent. This causes problems with proxies and bad implementations. So browsers in HTTP 1.1 opens multiple connections to get around this limitations. In H2 you can send any number of requests in the same connections in parallel. The reason is each request is uniquely identified with a streamid. So if we get a response we know what request it belongs to All of this is hidden from us programmers but its good to understand.. Watch my HTTP/2 playlist here to learn more HTTP/2 kzread.info/head/PLQnljOFTspQWbBegaU790WhH7gNKcMAl-

  • @sidharthvijayakumar3521
    @sidharthvijayakumar35218 ай бұрын

    This is not right load balancer layer 7 supports http 2. Recently i have created a flask app which only supports http 1.1 which using gunicorn which also does not support http 2 . Then used Cloudrun which was deployed as a backend to Classic application LB in GCP so my api in local shows as http 1.1 but the same Api in the load balancer i get it as http2 so i do not think what you said is relevant now.

  • @abnan0001
    @abnan00014 жыл бұрын

    Geodatabase related videos have been removed from your channel Could u please reupload then As the videos were helpful for us Thanks

  • @hnasr

    @hnasr

    4 жыл бұрын

    Muhammad Abnan hey Muhammed can you try again? Let me know..

  • @abnan0001

    @abnan0001

    4 жыл бұрын

    Hi It’s not there brother Last week I saw but since from afternoon I’m looking those But I cannot find it at all

  • @abnan0001

    @abnan0001

    4 жыл бұрын

    Nothing is there about geodatabase series and versioning related

  • @hnasr

    @hnasr

    4 жыл бұрын

    Muhammad Abnan Multi-User Geodatabase kzread.info/head/PLQnljOFTspQWseiNSmOMgsR5lgugKg_KP

  • @Emmanuel-px9lk
    @Emmanuel-px9lk4 жыл бұрын

    Why does HTTP 1.1 use '6' TCP connections? Is it a technical reason it is 6 or is this just a common standard?

  • @hnasr

    @hnasr

    4 жыл бұрын

    kidsWillSeeGhosts why 6 in particular I think it was anecdotal evidence that more than 6 doesn’t give more performance but more TCP overhead.. If you are asking Why H1 open many connections is to be able to send multiple requests in parallel (can’t do that in a single tcp connection) H2 allowed sending multiple requests in a single tcp connection using streams hope that helps 😊

  • 4 жыл бұрын

    If a lot of multiple objects are loaded in parallel, each object will just compete for this limited bandwidth, so each object will load proportionally slower. Also clients might be able to open hundreds of connections, but few web servers will want to do that, because they often are processing requests for many other users at the same time. A hundred simultaneous users, each opening 100 connections, will put the burden of 10,000 connections on the server. This can cause significant server slowdown.

  • @Emmanuel-px9lk

    @Emmanuel-px9lk

    4 жыл бұрын

    @ Thanks

  • @virgilbaldovin1852
    @virgilbaldovin18523 ай бұрын

    If someone asks me “what is an API?” i’ll send them this one

  • @akashdeepnandi
    @akashdeepnandi3 жыл бұрын

    21:57 that's what she said😂😂😂

  • @sawza0313
    @sawza03133 ай бұрын

    🎉👏🏼👏🏼👏🏼👏🏼👏🏼👏🏼

  • @AMFLearning
    @AMFLearning2 жыл бұрын

    amflearning by doing

  • @YineMiBen
    @YineMiBen3 жыл бұрын

    thanks youtube has 2x speed :)

  • @masterali3270
    @masterali32704 жыл бұрын

    انا رفيق علي احمد

  • @diaahs
    @diaahs Жыл бұрын

    That's what she said. 😂

  • @matsematse9034
    @matsematse90344 жыл бұрын

    can you make the videos in arabic too?

  • @hnasr

    @hnasr

    4 жыл бұрын

    matse matse I was considering making another channel as a test or at least include subtitles but it is a lot of work.

  • @masterali3270
    @masterali32704 жыл бұрын

    Hello

  • @masterali3270
    @masterali32704 жыл бұрын

    مرحبا

  • @pawan29121991
    @pawan291219914 ай бұрын

    Helllozzzz

  • @excelinaccounting8094
    @excelinaccounting8094Ай бұрын

    Hahaha thats what she said

  • @apoorvamishra5952
    @apoorvamishra59523 жыл бұрын

    stuff is good, you just need not to make the voices , a simple and straight way of talking would be more clear, i presume.

  • @suyashjain07
    @suyashjain072 жыл бұрын

    time consuming video. could be made bit shorter.

Келесі