P
P
Puma Thailand2012-07-28 12:48:31
Nginx
Puma Thailand, 2012-07-28 12:48:31

How do you do loadbalance in nginx depending on how busy the backends are?

I look at the loadbalance in nginx, everything is rotated there through round robin + backends that are not responding are excluded.
Is it possible to check server load by cpu for example.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
dirtyHabrBobr, 2012-07-28
@dirtyHabrBobr

github.com/gnosek/nginx-upstream-fair

A
Alexey Sundukov, 2012-07-28
@alekciy

It would be more effective to ask in the mailing list. But offhand, I note that they usually use the built-in perl.

T
Tonik, 2012-07-28
@Tonik

In nginx, this is not very well implemented. I advise you to try the scheme
nginx->haproxy->haproxy
backends are more advanced in terms of fair balancing

D
Daniel Newman, 2012-07-29
@danielnewman

And if HttpLuaModule instead of UpstreamFair ?

V
VBart, 2012-07-30
@VBart

Nginx can route not only by round-robin, but also by the number of connections, taking into account weights. Which quite well solve the problem of “give a request to the least loaded backend”.
nginx.org/r/least_conn/ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question