# HTTP2 Multiplexing

**URL:** <https://www.ruby-forum.com/t/http2-multiplexing/244562>\
**Category:** NGINX\
**Created:** [May 4, 2016, 5:25am UTC](https://www.ruby-forum.com/t/http2-multiplexing/244562 "2016-05-04T05:25:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [May 4, 2016, 5:25am UTC](https://www.ruby-forum.com/t/http2-multiplexing/244562/1 "2016-05-04T05:25:47Z")

</div>

Hi

Different from HTTP1.1 pipeline, HTTP2 allows multiple request and  
response  
messages to be in flight at the same time. I was wondering what the  
strategy Nginx adopt to implement this main feature.

Is every single stream correspond to a thread. If not, how can Nginx  
provide multiple parallel requests handling. If you can locate the  
correspond code for me, that would be great

Best Regards  
Muhui Jiang

---

<div class="post-metadata">

**Author:** ![Muhui\_Jiang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eada6e/32.png) [@Muhui\_Jiang](https://www.ruby-forum.com/u/Muhui_Jiang)\
**Post date:** [May 4, 2016, 12:19pm UTC](https://www.ruby-forum.com/t/http2-multiplexing/244562/2 "2016-05-04T12:19:57Z")

</div>

On Wednesday 04 May 2016 11:25:11 Muhui Jiang wrote:

> Hi
> 
> Different from HTTP1.1 pipeline, HTTP2 allows multiple request and response  
> messages to be in flight at the same time. I was wondering what the  
> strategy Nginx adopt to implement this main feature.

Nginx allows multiple request and responses in multiple connections  
using  
HTTP/1.x as well. HTTP/2 changes nothing here (except it uses only one  
connection, but it’s not important from the basic architecture point of  
view).

> Is every single stream correspond to a thread. If not, how can Nginx  
> provide multiple parallel requests handling. If you can locate the  
> correspond code for me, that would be great

No, nginx uses asynchronous non-blocking event-driven architecture  
instead of mapping requests into separate threads.

It have used multiplexing of requests handling in single process many  
years before HTTP/2 was invented.

A more detailed explanation can be found here:

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![Muhui\_Jiang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eada6e/32.png) [@Muhui\_Jiang](https://www.ruby-forum.com/u/Muhui_Jiang)\
**Post date:** [May 4, 2016, 12:50pm UTC](https://www.ruby-forum.com/t/http2-multiplexing/244562/3 "2016-05-04T12:50:55Z")

</div>

Hi

> Nginx allows multiple request and responses in multiple connections using  
> HTTP/1.x as well. HTTP/2 changes nothing here (except it uses only one  
> connection, but it’s not important from the basic architecture point of  
> view).

If so, it seems there is no difference or improvement of the  
implementation  
on the feature of multiplexing compared with Http/1.1 pipeline.

How do you solve the problem Head-of-line blocking occurred in Http/1.1.

Best Regards  
Muhui Jiang

2016-05-04 18:19 GMT+08:00 Valentin V. Bartenev [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Muhui\_Jiang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eada6e/32.png) [@Muhui\_Jiang](https://www.ruby-forum.com/u/Muhui_Jiang)\
**Post date:** [May 4, 2016, 1:18pm UTC](https://www.ruby-forum.com/t/http2-multiplexing/244562/4 "2016-05-04T13:18:58Z")

</div>

On Wednesday 04 May 2016 18:50:44 Muhui Jiang wrote:

> How do you solve the problem Head-of-line blocking occurred in Http/1.1.

[..]

You have mixed multiplexing of data transferring over single connection,  
which is the feature of HTTP/2, with multiplexing of requests processing  
inside one process, which is the feature of nginx.

These things have no relation to each other.

Please, read the article I’ve pointed out, nginx doesn’t need separate  
threads to process something in parallel.

The Head-of-line blocking problem in HTTP/1.1 is presented only if you  
use limited number of connections, and HTTP/2 solves it in some degree  
but puts the limit and the problem on different level.

With HTTP/2 now you have limit of virtual streams inside HTTP/2  
connection and the HOL problem on TCP level.

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![Muhui\_Jiang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eada6e/32.png) [@Muhui\_Jiang](https://www.ruby-forum.com/u/Muhui_Jiang)\
**Post date:** [May 5, 2016, 7:58pm UTC](https://www.ruby-forum.com/t/http2-multiplexing/244562/5 "2016-05-05T19:58:30Z")

</div>

Hi

Thanks Valentin. I’ve know the principle

Best Regards  
Muhui Jiang

2016-05-04 19:18 GMT+08:00 Valentin V. Bartenev [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
