On Sat, Mar 08, 2008, Adrian Chadd wrote: > Nothing terribly fancy; very, very ugly and not very well laid out; but > cut #1 of a simple TCP proxy that I'm using for toying around with network > IO benchmarking: > > http://www.creative.net.au/diffs/test1-320.tar.gz > > Edit Makefile.defaults to point to where libevent is hiding, and then 'make'. > The destination host/port is hardcoded in tcpproxy-1/test.c ; I point it at a > lighttpd/thttpd server and run apachebench against the proxy.
http://www.creative.net.au/diffs/test1-335.tar.gz * The tcp proxy has been very naively threaded (defaults to two threads atm) * I've included apachebench from apache-1.3, converted to use libevent and correctly complete the connect() sequence rather than hoping write-ready signified a successful connect. Its still single-threaded but it scales -enormously- better than before. I'm able to push this to about 5000 req/sec, 8000 concurrent client connections (so 16,000 concurrent TCP connections on the proxy) @ ~ 335mbit full-duplex on my test setup. I'm not maxing out anything yet as my thttpd opteron server is running at full steam. Again, its all LAN only traffic; there's a 16k read-ahead buffer being used here which settles the process at about 190 megabytes RSS. Thats not too bad for what its doing, but obviously its going to be a lot more in the real world if one goal is improved high-latency throughput. Is anyone interested in helping me out by duplicating my setup and running some basic tests? All you need is three sensible and recent servers, a gige switch and some spare time. I'm still trying to debug the odd race condition that showing up and resulting in mismatched content lengths. Adrian -- - Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support - - $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -