LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Question about the TCP splicing module (TCPSP)

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Question about the TCP splicing module (TCPSP)
From: Wensong Zhang <wensong@xxxxxxxxxxxx>
Date: Tue, 7 Oct 2003 23:31:46 +0800 (CST)

Hello,

On Sat, 4 Oct 2003, Bhuvan Urgaonkar wrote:

> Hello,
> 
> I have a question about using the TCP splicing module (TCPSP) that is 
> available at the lvs web site. I am using the Layer-7 switch ktcpvs as a 
> load balancer in front of a replicated web server. I'd like to also 
> have the TCP splicing feature to avoid the overhead of data copying 
> between the socket buffers that ktcpvs does. [Due to this copying, ktcpvs 
> becomes the bottleneck when the request rate to the web server is high.] 
> 

Actually, there is zero-copy feature inside the KTCPVS, it pulls skb 
(socket buffer) from one socket queue, and sends skb data to the other 
socket, there is no copying. The default is disabled, you can use "echo 1 
> /proc/sys/net/ktcpvs/zerocopy_send" to enable it. I am not sure if it is 
reliable. :)

Anyway, even without enabling the feature, KTCPVS has good throughput too. 
I have one box running ktcpvs at lab, it has PIII 800MHz CPU and two 
eepro100 NICs, it can get the throughput at 92 ~ 93Mbps. I don't know 
what's the performance with GigE box.

> I read a few papers about TCP splicing and got the impression that it can 
> be used to avoid this copying overhead. My question is with regard to the 
> example use of TCP splicing that comes with the TCPSP module. In this 
> example, a connection from a client is accepted. Then a new connection is 
> opened with a server. After this the tcp splicing call is made. Now my 
> understanding of TCP splicing was that this is all that needs to be done 
> and the TCPSP module would take care of the subsequent transfer of data 
> between the two connections. However, in the example, I see that the data 
> transfer has to be done explicitly (using the poll mechanism for finding 
> when more data has arrived on either connection) after the connections 
> have been "spliced". Why should this have to be done? 
> 

Well, I almost forget TCPSP code. This is just an example, poll is used
there to demostrate that once the two sockets are spliced, data can be
polled from the two sockets.

> I'd really appreciate any replies to my question. Also, any suggestions on 
> using the TCP splicing module with ktcpvs would be very valuable.
> 

I think that the major problem in TCP splicing is that it is not easy to
unsplice the connection, because TCP unsplice is needed by some
applications, such as persistent HTTP. For example, a client HTTP
connection requests two objects, one is at the server1, and the other is
at the server2. First, you need to splice the client connection and the
connection to server1, Second, you need to unsplice the client connection
the and the connection to server1. Third, splice the client connection and 
the connection to server2. But, the problem is when to unsplice the client 
connection and the connection to server1, then you probably need to parse 
the headers of response and know the exact size of response, it is 
becoming complicated. What if the client pipeline multiple requests in one 
single packet?

As for performance of KTCPVS, there can some work to improve it further,
for example, detaching a skb from receiving socket, and attaching the skb
at the sending socket directly.

Regards,

Wensong

<Prev in Thread] Current Thread [Next in Thread>