Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2010 13:06:48 -0800
From:      Chuck Swiger <>
To:        Adam Vande More <>, Chris Peiffer <>
Subject:   Re: ISO simple non-forking TCP connection forward/balance tool
Message-ID:  <>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

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.


Want to link to this message? Use this URL: <>