Re: [boost] Boost Asio on multi processor environment

Hi, I am designing a server which will going to run on multiprocessor and which will going to provide service to thousand of clients concurrently. I am using boost asio library to do this. I want to use one io_service object per CPU approach for this. Let me describe what I want... 1. I want to create ioservice object as per the no of CPU I have, so that I can distribute the load evenly. 2. How to create a list of ioservice object & make them running all the time even when there is no request to process. What's the definition of idle ioservice in this case... the one which is this the one which is not handling any connection? How can I choose a ioservice out of a pool of idle service whenever a new request comes from the client. 3. Can I restrict no of clients(connections) on each io service, lets say 500 connection on each ioservice or so ? Regards Gaurav Jain DISCLAIMER: This message contains privileged and confidential information and is intended only for an individual named. If you are not the intended recipient, you should not disseminate, distribute, store, print, copy or deliver this message. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version.

Hi,
I am designing a server which will going to run on multiprocessor and which will going to provide service to thousand of clients concurrently. I am using boost asio library to do this. I want to use one io_service object per CPU approach for this. Let me describe what I want...
1. I want to create ioservice object as per the no of CPU I have, so that I can distribute the load evenly. 2. How to create a list of ioservice object & make them running all the time even when there is no request to process. What's the definition of idle ioservice in this case... the one which is this the one which is not handling any connection? How can I choose a ioservice out of a pool of idle service whenever a new request comes from the client. 3. Can I restrict no of clients(connections) on each io service, lets say 500 connection on each ioservice or so ?
As far as I am aware, doing io_service.run() in multiple threads works just fine.

On Thu, 3 May 2007 17:29:27 +0530, Gaurav.Jain@iflexsolutions.com said:
1. I want to create ioservice object as per the no of CPU I have, so that I can distribute the load evenly. 2. How to create a list of ioservice object & make them running all the time even when there is no request to process.
See the example I referred to in my other reply.
What's the definition of idle ioservice in this case... the one which is this the one which is not handling any connection? How can I choose a ioservice out of a pool of idle service whenever a new request comes from the client. 3. Can I restrict no of clients(connections) on each io service, lets say 500 connection on each ioservice or so ?
These aspects are entirely up to you. Just design your "load-balancing" scheme (the io_service_pool::get_io_service() function in the example) so that it won't create a new connection on an io_service unless the load for the io_service meets your criteria. Cheers, Chris
participants (3)
-
Bigcheese
-
Christopher Kohlhoff
-
Gaurav.Jain@iflexsolutions.com