LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [Patch] Unconnected UDP

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Patch] Unconnected UDP
From: Horms <horms@xxxxxxxxxxxx>
Date: Tue, 2 Mar 2004 10:17:52 +0900
On Tue, Mar 02, 2004 at 12:25:22AM +0200, Julian Anastasov wrote:

Hi Julian, 

>       Hello,
> 
> On Mon, 1 Mar 2004, Horms wrote:
> 
> > The attached patches for LVS and ipvsadm add a flag to services
> > to allow them to treat UDP as unconnected, the current code
> > assumes connected udp. More specifically, it sets the connection
> > entry timout to 0. This probably could have been done more
> > efficiently, but I tried to make the change in keeping with the
> > current code base. The default for this option is off which gives
> > the existing behaviour.
> 
>       It is interesting, where is this feature used?

I am playing around with some load balancing aplications that use UDP.
This seemed to make things work more natrually for the connections
that we were seeing. Sorry to be a bit vauge, I will post more when I
can, but this seemed to be generally useful so I thought I would let it
out earlier rather than later.

>       I remember I created similar thing: ops-0.9.5-4.diff,
> it is on the bottom of my page. Note that using timeout 0 is not a
> good idea for the following reasons:
> 
> - the connection lives for 1/HZ time which can be bad in some setups,
> may be you can avoid hashing the conn
> 
> - there is a race on SMP with the new kernel timers because two
> IPVS packet handlers can modify the timer twice or more times
> at the time when the kernel timers start on one or many CPUs.
> The following change fixed this race for IPVS 2.6 and now it is still
> not allowed to use short timeouts (<= 1 jiffie):
> 
> http://linux.bkbits.net:8080/linux-2.5/diffs/net/ipv4/ipvs/ip_vs_conn.c@xxxx?nav=index.html|src/|src/net|src/net/ipv4|src/net/ipv4/ipvs|hist/net/ipv4/ipvs/ip_vs_conn.c
> 
>       The fix for this 2nd problem is again to avoid hashing the
> connection, then only one CPU can use mod_timer for it.
> 
>       So, if hashing is avoided we achieve real per-packet scheduling.

Ok, thanks for that. It should be possible to avoid hashing all
together. I also relised there are a few minor bugs. I will post a new
version shortly.

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