Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balancing algorithm #25

Open
MartinKirchner opened this issue Mar 8, 2016 · 1 comment
Open

Balancing algorithm #25

MartinKirchner opened this issue Mar 8, 2016 · 1 comment

Comments

@MartinKirchner
Copy link

Hi UlricE,

in your wiki I could not find any hint what balancing algorithm is used by pen.
By what I observe on my endpoints I assume the endpoint is chosen based on the IP. Is that correct?
How is the server chosen for a specific request?
Thanks in advance.

Kind regards,
Martin Kirchner

@UlricE
Copy link
Owner

UlricE commented Mar 9, 2016

There are several server selection algorithms. The default is roundrobin with IP-based client tracking. In this mode a client connecting repeatedly from the same source address will be sent to the same backend server. That is usually the safe thing to do because some web applications keep state on the individual servers and would be confused by clients getting sent to different backends.

The other algorithms are listed in the penctl manpage. They are:

  • prio: always use the server with the highest priority as long as it is available
  • weight: distribute clients according to the weights assigned to servers (i.e. a server with weight 200 will receive twice as many requests as a server with weight 100)
  • hash: use a hash on the source IP address to select the server

It is also possible to direct clients to or from servers based on access control lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants