On Fri, Sep 13, 2013 at 8:19 AM, Kinkie <gkinkie@xxxxxxxxx> wrote: > On Fri, Sep 13, 2013 at 4:15 AM, Jeffrey Walton <noloader@xxxxxxxxx> wrote: >> I'm looking for the implementation details of how squid proxies its >> connections. That is (in pseudo code): >> >> socket src = ... // client socket >> socket dest = ... // server socket >> >> int n = read(src, buffer) >> write(dest, buffer, n) >> >> I imagine its not that naive, and I'm really interested in the >> techniques squid uses to improve performance around that locus. > Squid uses an event-driven approach, based on select(2) and its more > modern and effective heirs, depending on what the OS supports. > You can find most of the relevant code in the src/comm/ subdirectory > of the source tree, as well as in comm.cc Thanks Kinkie. I've had more time to look at this. I see some of the Async stuff in comm.cc, and I'll need to study it more. I did not see use of kqueues. Does Squid make use of libevent or another similar library? Does Squid support Mac OS X and OpenBSD? Mac OS X and OpenBSD are itneresting to me because eventually an OpenBSD appliance is one of my goals. Jeff