Tom
Tom

Reputation:

Load Balance in Distributed Project

Does anyone know a simple load balance algorithm (formula) that relates users connected, cpu load, network load and memory usage? This will be used to compare various servers and assign to a new user the best at the moment. Thank You.

Upvotes: 3

Views: 2109

Answers (3)

Ztyx
Ztyx

Reputation: 14959

Have a look at haproxy. It is an extremelly stable and fast load HTTP/TCP load balancer that is being used by some extremelly trafficed websites.

Distributed session handling is needed accordingly (see kgiannakakis) for details.

Upvotes: 0

Ztyx
Ztyx

Reputation: 14959

Have a look at nginx. It is easy do configure, very fast and handles load balancing between servers.

Distributed session handling is needed accordingly (see kgiannakakis) for details.

Upvotes: 0

kgiannakakis
kgiannakakis

Reputation: 104196

If you are using Apache Web Server to proxy the application servers, I recommend that you use mod_proxy and mod_proxy_balancer. You can find a quick introduction about mod_proxy here. This is about Jetty, but it is easily applicable to other servers.

The first thing that you need to worry about clustering is the way sessions are handled. You need to be sure that a request belonging to a session is directed to the same server (or the session is somehow persisted and then always retrieved). Mod_proxy can do this for you.

Regarding the load balancing algorithm, see the documentation of mod_proxy_balancer. According to it, there are 3 load balancer scheduler algorithms.

An older solution to load balancing is mod_jk.

In general, this is not something I would implement myself, even if I had a better algorithm. It is better to use an existing solution.

Upvotes: 3

Related Questions