Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux Virtual Server: Users

[lvs-users] different algorithms and persistence

 

 

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded


lorddoskias at gmail

Oct 25, 2007, 2:03 PM

Post #1 of 8 (387 views)
Permalink
[lvs-users] different algorithms and persistence

Hello all,

I have some problems understanding the persistence with the different
scheduling algos. First let's start with RR and LC:

When one requests a resource using one of the two algorithms it will get
routed to some of the real servers. And what will happen to any
subsequent TCP packets belonging to the same connection? For example if
we log on a web server and on any subsequent request we want to hit the
same server where our auth info is. How is this achieved?

Now about the source hashing and destination hashing. Source hashing
refers to which source ip? The client's? And the destination? Isn't the
destination ip always the same - the virtual ip?

From what I have read the locality based algos are based on some sort
of hashing mechanism that hashes the client ip address and so a client
is always sure to hit the same server on any subsequent requests. Have I
understood well the conception about the LC.


I think more distinct and precise information should be entered in the
LVS howto. Also a separate section covering the scheduling algo will be
a good addition to the howto.

Regards, Nikolay.

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


jmack at wm7d

Oct 25, 2007, 4:14 PM

Post #2 of 8 (378 views)
Permalink
Re: [lvs-users] different algorithms and persistence [In reply to]

On Fri, 26 Oct 2007, Nikolaj wrote:

> When one requests a resource using one of the two algorithms it will get
> routed to some of the real servers.

one of the realservers
^^^

> And what will happen to any
> subsequent TCP packets belonging to the same connection?

will go to the same realserver (you can't break a tcpip
connection)

> Now about the source hashing and destination hashing. Source hashing
> refers to which source ip?

source of the packet coming from the internet

> The client's? And the destination? Isn't the
> destination ip always the same - the virtual ip?

I forget what DH balances on. I thought I wrote it up in the
HOWTO.

> I think more distinct and precise information should be entered in the
> LVS howto. Also a separate section covering the scheduling algo will be
> a good addition to the howto.

It would be a wonderful contribution. Would you be prepared
to write it up?

Thanks
Joe

--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


lorddoskias at gmail

Oct 26, 2007, 1:54 AM

Post #3 of 8 (374 views)
Permalink
Re: [lvs-users] different algorithms and persistence [In reply to]

Joseph Mack NA3T wrote:
> On Fri, 26 Oct 2007, Nikolaj wrote:
>
>> When one requests a resource using one of the two algorithms it will get
>> routed to some of the real servers.
>
> one of the realservers
> ^^^
>
>> And what will happen to any
>> subsequent TCP packets belonging to the same connection?
>
> will go to the same realserver (you can't break a tcpip
> connection)
Basically when a connection is established LVS creates some sort of a
connection table and looks it up to see if there is a connection with
the parameters in the TCP packet (sequence number, dest ip address) etc.
right and after a certain amount of time this info expires?


>
>> Now about the source hashing and destination hashing. Source hashing
>> refers to which source ip?
>
> source of the packet coming from the internet
>
If I'm right about the hashing as I said above, what's the difference
with source hashing? For example if a given ip has already made a
connection to one service and made another connection to a different
service but with the same source ip address the second connection will
be redirected to the same real server as the first one, won't it?


>> The client's? And the destination? Isn't the
>> destination ip always the same - the virtual ip?
>
> I forget what DH balances on. I thought I wrote it up in the
> HOWTO.
>
>> I think more distinct and precise information should be entered in the
>> LVS howto. Also a separate section covering the scheduling algo will be
>> a good addition to the howto.
>
Excerpt from the howto
"The -dh (destination hash) algorythm makes a hash from the target IP
and all requests to that IP will be sent to the same realserver. This
means that content from a URL will not be retrieved multiple times from
the remote server. The realservers (eg squids in this case) will each be
retreiving content from different URLs."

But the client doesn't know what are the real ips of the real servers
how can they be cached (the ip addresses)? Or maybe LVS hashes the
destination ip after it receives the packets and decides to witch real
server to send it?



> It would be a wonderful contribution. Would you be prepared
> to write it up?
>
I'm ready to write it, as soon as I'm confident with the differences
between the different scheduling algorithms and the pros and cons.

> Thanks
> Joe
>
Regards

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


jmack at wm7d

Oct 26, 2007, 3:15 AM

Post #4 of 8 (375 views)
Permalink
Re: [lvs-users] different algorithms and persistence [In reply to]

On Fri, 26 Oct 2007, Nikolaj wrote:

> If I'm right about the hashing as I said above, what's the difference
> with source hashing?

what's the difference between source hashing and what?

> For example if a given ip has already made a
> connection to one service and made another connection to a different
> service but with the same source ip address the second connection will
> be redirected to the same real server as the first one, won't it?

if the client makes a 2nd connection to the same virtual
service at some later time, the connection will go to the
same realserver.

> Excerpt from the howto
> "The -dh (destination hash) algorythm makes a hash from the target IP
> and all requests to that IP will be sent to the same realserver. This
> means that content from a URL will not be retrieved multiple times from
> the remote server. The realservers (eg squids in this case) will each be
> retreiving content from different URLs."
>
> But the client doesn't know what are the real ips of the real servers
> how can they be cached (the ip addresses)? Or maybe LVS hashes the
> destination ip after it receives the packets and decides to witch real
> server to send it?

-DH is for squids. The target address is the IP of the URL,
not the VIP or the RIP

> I'm ready to write it, as soon as I'm confident with the differences
> between the different scheduling algorithms and the pros and cons.

great

Joe
--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


lorddoskias at gmail

Oct 26, 2007, 5:33 AM

Post #5 of 8 (373 views)
Permalink
Re: [lvs-users] different algorithms and persistence [In reply to]

Joseph Mack NA3T wrote:
> On Fri, 26 Oct 2007, Nikolaj wrote:
>
>> If I'm right about the hashing as I said above, what's the difference
>> with source hashing?
>
> what's the difference between source hashing and what?
>
The difference between source hashing and round-robin. If someone makes
a connection and with round robin is redirected to realserve1 (for
example) won't the subsequent connections to the same service go to the
same realserver1? Because when a connection is made (irrespective of the
used algo) LVS hashes the attributes of that connection - IPs, sequence
numbers etc?

>> For example if a given ip has already made a
>> connection to one service and made another connection to a different
>> service but with the same source ip address the second connection will
>> be redirected to the same real server as the first one, won't it?
>
> if the client makes a 2nd connection to the same virtual
> service at some later time, the connection will go to the
> same realserver.
>
>> Excerpt from the howto
>> "The -dh (destination hash) algorythm makes a hash from the target IP
>> and all requests to that IP will be sent to the same realserver. This
>> means that content from a URL will not be retrieved multiple times from
>> the remote server. The realservers (eg squids in this case) will each be
>> retreiving content from different URLs."
>>
>> But the client doesn't know what are the real ips of the real servers
>> how can they be cached (the ip addresses)? Or maybe LVS hashes the
>> destination ip after it receives the packets and decides to witch real
>> server to send it?
>
> -DH is for squids. The target address is the IP of the URL,
> not the VIP or the RIP
>
Hmz, I'm baffled. For example if I want to retrieve 212.250.235.20
(random ip address) isn't it necessary to have this ip as VIP bound on a
LVS redirector? If you could elaborate on this, please.

>> I'm ready to write it, as soon as I'm confident with the differences
>> between the different scheduling algorithms and the pros and cons.
>
> great
>
> Joe


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


jmack at wm7d

Oct 26, 2007, 6:13 AM

Post #6 of 8 (375 views)
Permalink
Re: [lvs-users] different algorithms and persistence [In reply to]

On Fri, 26 Oct 2007, Nikolaj wrote:

>> what's the difference between source hashing and what?
>>
> The difference between source hashing and round-robin. If someone makes
> a connection and with round robin is redirected to realserve1 (for
> example) won't the subsequent connections to the same service go to the
> same realserver1?

with round robin, the next connection from any client will
go to realserver2

> Hmz, I'm baffled. For example if I want to retrieve 212.250.235.20
> (random ip address) isn't it necessary to have this ip as VIP bound on a
> LVS redirector? If you could elaborate on this, please.

no. squids (or their lvs equivalent) function as
pass-through machines.

Joe
--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


lorddoskias at gmail

Oct 26, 2007, 7:12 AM

Post #7 of 8 (375 views)
Permalink
Re: [lvs-users] different algorithms and persistence [In reply to]

Joseph Mack NA3T wrote:
> On Fri, 26 Oct 2007, Nikolaj wrote:
>
>>> what's the difference between source hashing and what?
>>>
>> The difference between source hashing and round-robin. If someone makes
>> a connection and with round robin is redirected to realserve1 (for
>> example) won't the subsequent connections to the same service go to the
>> same realserver1?
>
> with round robin, the next connection from any client will
> go to realserver2
>
So with RR a connection will go to the same server until a packet with
TCP FIN is received from the client? Basically with round robin a client
is redirected to real server when it wants to establish a tcp connection
and all packets belonging to this connection goes to the same real
server. Whereas with source hashing even when the connection is finished
(packet with FIN flag) subsequent connections from the same ip will go
to the same real server.

>> Hmz, I'm baffled. For example if I want to retrieve 212.250.235.20
>> (random ip address) isn't it necessary to have this ip as VIP bound on a
>> LVS redirector? If you could elaborate on this, please.
>
> no. squids (or their lvs equivalent) function as
> pass-through machines.
>
> Joe


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


jmack at wm7d

Oct 26, 2007, 7:28 AM

Post #8 of 8 (373 views)
Permalink
Re: [lvs-users] different algorithms and persistence [In reply to]

On Fri, 26 Oct 2007, Nikolaj wrote:

> So with RR
^^
any tcpip connection

> a connection will go to the same server until a packet
> with TCP FIN is received from the client? Basically with
> round robin
^^^^^^^^^^^

any scheduler

> a client is redirected to real server when it
> wants to establish a tcp connection and all packets
> belonging to this connection goes to the same real server.


> Whereas with source hashing even when the connection is
> finished (packet with FIN flag) subsequent connections
> from the same ip will go to the same real server.

yes

Joe

--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.