# Scalability issue

**URL:** <https://www.ruby-forum.com/t/scalability-issue/163764>\
**Category:** NGINX\
**Created:** [March 24, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/scalability-issue/163764 "2009-03-24T18:20:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![howard\_chen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@howard\_chen](https://www.ruby-forum.com/u/howard_chen)\
**Post date:** [March 24, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/scalability-issue/163764/1 "2009-03-24T18:20:23Z")

</div>

Hey

I am new to nginx.

According to the web: [Welcome to NGINX Wiki! | NGINX](http://wiki.nginx.org/Main)

It said…

Nginx is one of a handful of servers written to address the C10K  
problem. Unlike traditional servers, Nginx doesn’t rely on threads to  
handle requests. Instead it uses a much more scalable event-driven  
(asynchronous) architecture. This architecture uses small, but most  
importantly, predictable amounts of memory under load…

But my questions are…

1. No matter how fast you are delivering the data, it is bounded by  
only one thread, so it is not scalable as nowsaday if you have 8 core

- server?

1. Even you are using event-driven, remote clients must also need to  
establish a remote port to your web server, so you can’t save much  
resources in fact?

Thank you .

---

<div class="post-metadata">

**Author:** ![howard\_chen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@howard\_chen](https://www.ruby-forum.com/u/howard_chen)\
**Post date:** [March 24, 2009, 7:04pm UTC](https://www.ruby-forum.com/t/scalability-issue/163764/2 "2009-03-24T19:04:53Z")

</div>

Hello!

On Wed, Mar 25, 2009 at 01:12:29AM +0800, howard chen wrote:

> handle requests. Instead it uses a much more scalable event-driven  
> (asynchronous) architecture. This architecture uses small, but most  
> importantly, predictable amounts of memory under load…
> 
> But my questions are…
> 
> 1. No matter how fast you are delivering the data, it is bounded by  
> only one thread, so it is not scalable as nowsaday if you have 8 core
> 
> - server?

No. You just configure nginx to run 8 worker processes - and this  
effectively uses all available CPU resources with minimal  
overhead.

> 1. Even you are using event-driven, remote clients must also need to  
> establish a remote port to your web server, so you can’t save much  
> resources in fact?

Yes, you can’t save sockets. No, there is a lot of resources that  
saved in fact compared to thread-per-connection or  
process-per-connection models, since thread is much more than  
socket.

Maxim D.

---

<div class="post-metadata">

**Author:** ![howard\_chen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@howard\_chen](https://www.ruby-forum.com/u/howard_chen)\
**Post date:** [March 24, 2009, 6:58pm UTC](https://www.ruby-forum.com/t/scalability-issue/163764/3 "2009-03-24T18:58:22Z")

</div>

1. You can configure nginx to use as many instances as you want. If your  
server is 8 core, you can set nginx to use 8 instances. So this is not  
an  
issue.
2. I don’t really understand what you mean.

Sergej

---

<div class="post-metadata">

**Author:** ![howard\_chen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@howard\_chen](https://www.ruby-forum.com/u/howard_chen)\
**Post date:** [March 24, 2009, 7:05pm UTC](https://www.ruby-forum.com/t/scalability-issue/163764/4 "2009-03-24T19:05:28Z")

</div>

On Wed, 2009-03-25 at 01:12 +0800, howard chen wrote:

> 1. No matter how fast you are delivering the data, it is bounded by  
> only one thread, so it is not scalable as nowsaday if you have 8 core
> 
> - server?

Nginx can use as many cores as you have available (via worker  
processes). But this question is overly simplistic anyway. There’s  
more to a server than CPU utilization.

> 1. Even you are using event-driven, remote clients must also need to  
> establish a remote port to your web server, so you can’t save much  
> resources in fact?

A thread uses quite a lot of RAM (the exact amount is system-dependent),  
so by not using them you do, in fact, save a lot of resources. There’s  
also things like kernel context-switches, CPU cache invalidation and  
other things that make threads less efficient than event-driven  
architectures.

There’s quite a lot of information on the pros-and-cons of event-driven  
vs threaded servers available on the internet. Google is your friend.

Regards,  
Cliff
