Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::asio with thousands of concurrent connections
From: Bill Buklis (boostusr_at_[hidden])
Date: 2012-02-09 15:04:46

On 2/9/2012 1:04 PM, Gheorghe Marinca wrote:
> Hi,
> I started to use boost::asio some time ago and want to use it for a
> windows commercial product that does web filtering and handles
> thousands of connections concurrently (proxy based product)
> I am wandering if anybody had experience using it at such a large
> scale, where besides handling many connections you have to handle
> inside a connection communication with databases, things that
> potentially incur delaying handling of subsequent requests. What kind
> of configuration would you advise in such a case (multiple I/O
> services per n threads, on IO service that handles all incoming
> connections and a thread pool that handles processing of async
> handlers - how one would assure in this case a connections is handled
> in the same thread then ..etc)
> Thanks for any input
> -Ghira

I haven't used boost::asio yet, so I can't speak for its capabilities,
but on Windows I/O completion ports are definitely the way to go for
handling large numbers of connections. You basically set up a pool of
worker threads that the OS automatically cycles through whenever there
is any socket activity waiting to be handled. The pool is shared among
all connections and not divided into any specific grouping, such as n
connections per thread.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at