1

HTTP2 has this multiplexing feature.

From this [answer](Put simply, multiplexing allows your Browser to fire off multiple requests at once on the same connection and receive the requests back in any order.) we get that:

Put simply, multiplexing allows your Browser to fire off multiple requests at once on the same connection and receive the requests back in any order.

Let's say I split my app into 50 small bundled files, to take advantage of the multiplex communication.

My server is an express app hosted in a Cloud Run instance.

Here is what Cloud Run says about concurrency:

By default Cloud Run container instances can receive many requests at the same time (up to a maximum of 250).

So, if 5 users hit my app at the same time, does it mean that my instance will be max'ed out for a brief moment?

Because each browser (from the 5 users) will make 50 requests (for the 50 small bundled files), resulting on a total of 250.

Does the fact that multiplex traffic occurs on over the same connection change any thing? How does it work?

Does it mean that my cloud run will perceive 5 connections and my express server will perceive 250 requests? I think I'm confused about the request expression in these 2 perspectives (the cloud run instance and the express server).

cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
  • in http2 there will be only one request (one TCP connection) through which all the files will be fetched. There's a limit to how many files can be downloaded at the same time (using the same connection) but normally it's about 100. – marzelin Jan 19 '21 at 16:16
  • Thanks. So my instance will perceive it as 5 connections? And my express server will perceive 250 get requests? Is this it? – cbdeveloper Jan 19 '21 at 16:17
  • I think so. If the traffic is encrypted cloud servers can only see and count TCP connections, not what's going on inside each of them. With http1 each file would have to create a separate connection to be downloaded at the same time. – marzelin Jan 19 '21 at 16:28
  • @marzelin makes sense! I think you are right. It's all through SSL. So the decryption only occurs once it reaches the `express` server? – cbdeveloper Jan 19 '21 at 16:33
  • SSL was replaced by TLS long time ago, the proper name is TLS even though people still speak about SSL certificates. When it comes to cloud, it depends on configuration. You can delegate encryption to Cloud Provider - your server can get decrypted traffic and CP's reverse proxy will take care of securing it, or you may do it all by yourself. – marzelin Jan 19 '21 at 16:59
  • @marzelin - `SSL Certificate` is still correct as a noun or production name and refers to the format of a file and not the protocol (Secure Sockets Layer replaced by Transport Layer Security). – John Hanley Jan 20 '21 at 02:57

1 Answers1

3

A "request" is :

  • the establishment of the connexion between the server and the client (the browser here)
  • The data transfert
  • The connexion close.

With streaming capacity of HTTP2 and websocket, the connexion can takes minutes (and up to 1 hour) and you can send data through the channel as you want. 1 connexion = 1 request, 5 connexions = 5 requests.

But keep in mind that keeping this connexion open and processing data in it consume resources on your backend and you can't have dozens of connexion that actively send/receive data, you will saturate your instance.

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76