# Can thread pool improve performance for such scenario

**URL:** <https://www.ruby-forum.com/t/can-thread-pool-improve-performance-for-such-scenario/242521>\
**Category:** NGINX\
**Created:** [June 30, 2015, 8:03am UTC](https://www.ruby-forum.com/t/can-thread-pool-improve-performance-for-such-scenario/242521 "2015-06-30T08:03:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [June 30, 2015, 8:03am UTC](https://www.ruby-forum.com/t/can-thread-pool-improve-performance-for-such-scenario/242521/1 "2015-06-30T08:03:38Z")

</div>

Hi All:  
I am using Nginx as a reverse proxy which provide a web API (HTTP GET  
) to client.  
and the backend application will get request from nginx and do some  
time-consuming processing (1-2 seconds) then response result to nginx,  
Nginx return result to client.  
I think this is synchronize operation.

As I know, Nginx import thread pools feature, so is it useful for my  
scenario and improve performance?

–  
Rejoice,I Desire!

---

<div class="post-metadata">

**Author:** ![Jerry\_OELoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@Jerry\_OELoo](https://www.ruby-forum.com/u/Jerry_OELoo)\
**Post date:** [June 30, 2015, 9:53am UTC](https://www.ruby-forum.com/t/can-thread-pool-improve-performance-for-such-scenario/242521/2 "2015-06-30T09:53:28Z")

</div>

Hi,

This is what they have to say about threads :

Offloading read operations to the thread pool is a technique applicable  
to  
very specific tasks. It is most useful where the volume of frequently  
requested content doesn’t fit into the operating system’s VM cache. This  
might be the case with, for instance, a heavily loaded NGINX-based  
streaming media server. This is the situation we’ve simulated in our  
benchmark.

* * *

So if you got storage which doesn’t fit into Ram such as 2TB storage  
with  
32Gb RAM . In this case, threads could be useful. Otherwise, nginx is  
already very much robust to serve concurrent requests against standard  
extensions such as jpeg,css,html and many more.

You can read more about threads in following link :

> **[Boosting NGINX Performance 9x with Thread Pools](https://www.nginx.com/blog/thread-pools-boost-performance-9x/)**
>
> Learn how the thread pool in NGINX 1.7.11 and NGINX Plus R7 boosts performance up to 9 times by offloading blocking operations from the worker process

Regards.  
Shahzaib

---

<div class="post-metadata">

**Author:** ![Jerry\_OELoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@Jerry\_OELoo](https://www.ruby-forum.com/u/Jerry_OELoo)\
**Post date:** [June 30, 2015, 11:18am UTC](https://www.ruby-forum.com/t/can-thread-pool-improve-performance-for-such-scenario/242521/3 "2015-06-30T11:18:11Z")

</div>

> Hi All:  
> I am using Nginx as a reverse proxy which provide a web API (HTTP GET  
> ) to client.  
> and the backend application will get request from nginx and do some  
> time-consuming processing (1-2 seconds) then response result to nginx,  
> Nginx return result to client.  
> I think this is synchronize operation.

What backend protocol? HTTP/TCP? That not blocking at all, no need  
to improve anything. What the thread pool currently improves is  
sendfile() I/O operations.

Lukas

---

<div class="post-metadata">

**Author:** ![Jerry\_OELoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@Jerry\_OELoo](https://www.ruby-forum.com/u/Jerry_OELoo)\
**Post date:** [June 30, 2015, 1:19pm UTC](https://www.ruby-forum.com/t/can-thread-pool-improve-performance-for-such-scenario/242521/4 "2015-06-30T13:19:41Z")

</div>

Backend is uwsgi TCP protocol.  
Thanks for your clarify. I am understanding now, Thread pool should  
not useful to improve my case.

On Tue, Jun 30, 2015 at 5:17 PM, Lukas T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> sendfile() I/O operations.
> 
> Lukas
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

–  
Rejoice,I Desire!
