0

I would like to understand the LVS persistence. For me, all the client with the same address ip will go to the same server until the end of the timeout. And if clients are behind a provider/proxy/firewall or public addresses, they all go to the same real server but in terms of performance isn't very good.

I would like to try to understand with an example: The university only have one IP and use the NAT, so if all the students wants to connect to the webpage, they will all go to the same real server?

on this link http://www.ntua.gr/lvsp/Joseph.Mack/HOWTO/LVS-HOWTO.fwmark.html part 8.10.2 examples, it's right that 2 clients ( different IP but comes from the same router/firewall) will choose different servers. Does it's true with the example that I give?

Zypher
  • 37,405
  • 5
  • 53
  • 95
tranen
  • 1
  • 1
  • yes but because of the proxy problem, does it really possible to use it for session? because if everybody use the same real server (in case of a proxy) the load balancing not really work. –  Mar 17 '11 at 08:56

2 Answers2

3

If all your clients come in from a single source IP address and you are using persistence then yes they will all chose a single realserver.

One possible solution to your load issue would be to advertise two different A records in your DNS for the load-balanced site. You could combine this with FWMARK, as described in the section you refer to above, to force the large source IP address in your traffic to chose realserver 1 for your first A record and realserver 2 for your second.

dmourati
  • 25,540
  • 2
  • 42
  • 72
1

For me, all the client with the same address ip will go to the same server until the end of the timeout.

True.

But what's happened if clients are behind a provider/proxy/firewall or public addresses?

LVS cares about IP's and don't try to see if the user have a proxy. So, the LVS will see the IP of proxy.

Does they all go to the same real server?

Yes.

if yes the load balancing isn't really useful in this case, so how it's possible to handle sessions correctly?

For http is simple, you can use apache mod proxy balancer together with HA. For other protocols you should search on Internet

Sacx
  • 2,581
  • 16
  • 13
  • 1
    Thanks, I would like to try to understand with an example: The university only have one IP and use the NAT, so if all the students wants to connect to the webpage, they will all go to the same real server? – tranen Mar 15 '11 at 10:04
  • Exactly. This is the main problem with LVS persistance and proxy. – Sacx Mar 16 '11 at 13:04
  • Thanks, so when or for what do people use LVS with persistence? –  Mar 17 '11 at 01:35
  • When they are expecting traffic from multiple source ip's :) and they want to stick an IP to one server (session things etc) – Sacx Mar 17 '11 at 07:33