# Load Balancing Algorithm

**URL:** <https://www.ruby-forum.com/t/load-balancing-algorithm/223709>\
**Category:** NGINX\
**Created:** [October 15, 2012, 6:29am UTC](https://www.ruby-forum.com/t/load-balancing-algorithm/223709 "2012-10-15T06:29:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [October 15, 2012, 6:29am UTC](https://www.ruby-forum.com/t/load-balancing-algorithm/223709/1 "2012-10-15T06:29:54Z")

</div>

Hi All,

Is it possible for me to change the load balancing algorithm used in  
Nginx.??

Thank you in advance for the reply,

aps.

---

<div class="post-metadata">

**Author:** ![Aparna\_Bhat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@Aparna\_Bhat](https://www.ruby-forum.com/u/Aparna_Bhat)\
**Post date:** [October 15, 2012, 12:02pm UTC](https://www.ruby-forum.com/t/load-balancing-algorithm/223709/2 "2012-10-15T12:02:57Z")

</div>

Hello!

On Mon, Oct 15, 2012 at 09:59:06AM +0530, Aparna Bhat wrote:

> Is it possible for me to change the load balancing algorithm used in Nginx.??

Yes. As of vanilla nginx, the following balancing algorithms are  
available:

- round-robin (default)
- least conn, see [Module ngx\_http\_upstream\_module](http://nginx.org/r/least_conn)
- ip hash, see [Module ngx\_http\_upstream\_module](http://nginx.org/r/ip_hash)

It is also possible to use 3rd party balancing modules (there are  
number of them available, see [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/3rdPartyModules)).  
And obviously you may write your own.

–  
Maxim D.

> **[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.
