Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2010 13:06:48 -0800
From:      Chuck Swiger <cswiger@mac.com>
To:        Adam Vande More <amvandemore@gmail.com>, Chris Peiffer <bsdlists@cabstand.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: ISO simple non-forking TCP connection forward/balance tool
Message-ID:  <9453972A-7AE8-4E4E-825F-2514BB36CA45@mac.com>
In-Reply-To: <6201873e1001221221g5491ba85l75fd6d6f01c009f@mail.gmail.com>
References:  <20100122200138.GA19469@cabstand.com> <6201873e1001221221g5491ba85l75fd6d6f01c009f@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi--

On Jan 22, 2010, at 12:21 PM, Adam Vande More wrote:
> A few lines in python should do what you're looking for, see socket lib,
> twisted if you have high performance needs.

I'm a big fan of python, but you'd have to be careful to choose the right processing model-- some sort of select()/poll()/kqueue() wrapper with nonblocking I/O and process-towards-completion semantics rather than trying to do multithreaded approach, since the GIL will really interfere with concurrency.

Note that the intended usage also matters quite a bit.  For example, NAT-based solutions depend on the destinations being up all of the time and will happily drop a third (or whatever) of the traffic into the void if one of the backend boxes is down or a service is unresponsive.  Software-based load-balancers which recognize and route around downed ports or boxes play nicer for this sort of thing, as do H/W load-balancer solutions like Foundry ServerIrons & Citrix NetScalers, which have liveness checks built in to test destinations and make sure they stay up before distributing traffic onto them.

There's also a question of whether the traffic ought to be stateful beyond individual connections, in which case software-based solutions like FastCGI or WebObjects which support session affinity are a much better idea than trying to write stateless services which have to persist to a backend database or something along those lines for every request.

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9453972A-7AE8-4E4E-825F-2514BB36CA45>